Merge "Fix sanitizer errors in bootstat.cpp." am: 9ddf491492
am: 2fbf6f1083

Change-Id: Ia2fd1bf3245998cf9e6c14b2b45af0b8cc0adcb0
diff --git a/bootstat/bootstat.cpp b/bootstat/bootstat.cpp
index f81206a..a1fcad8 100644
--- a/bootstat/bootstat.cpp
+++ b/bootstat/bootstat.cpp
@@ -429,9 +429,11 @@
     if (needle.length() > pos) return std::string::npos;
     pos -= needle.length();
     // fuzzy match to maximum kBitErrorRate
-    do {
+    for (;;) {
       if (numError(pos, needle) != std::string::npos) return pos;
-    } while (pos-- != 0);
+      if (pos == 0) break;
+      --pos;
+    }
     return std::string::npos;
   }