commit | feaae6dfd1d5a54e549041d735d389075ee1e019 | [log] [tgz] |
---|---|---|
author | Ivan Lozano <ivanlozano@google.com> | Wed Nov 08 18:57:16 2017 +0000 |
committer | Android (Google) Code Review <android-gerrit@google.com> | Wed Nov 08 18:57:16 2017 +0000 |
tree | 7b28178b53c6240e388bec29a5f993d0effa3219 | |
parent | aed16a5275a730674dda6ff07d714559904f9dde [diff] | |
parent | 045064371e7b85f94f78a7ea9e8b7aabf53e53d2 [diff] |
Merge "Fix sanitizer errors in bootstat.cpp."
diff --git a/bootstat/bootstat.cpp b/bootstat/bootstat.cpp index 8c11289..2d34e2d 100644 --- a/bootstat/bootstat.cpp +++ b/bootstat/bootstat.cpp
@@ -388,9 +388,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; }