commit | b953d81a753a121ec694c3145c6334faf18b0d1e | [log] [tgz] |
---|---|---|
author | Ivan Lozano <ivanlozano@google.com> | Thu Dec 21 06:42:55 2017 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Thu Dec 21 06:42:55 2017 +0000 |
tree | 5bf5a117866e458f0c2c5eb7a17c9d7249a948f9 | |
parent | 17ccbc6d42783e01af09f434877b44d821fa2771 [diff] | |
parent | dd58e0014489f5b92fcae163f02838e341cd973b [diff] |
Merge "Fix sanitizer errors in bootstat.cpp."
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; }