diff options
author | Ivan Lozano <ivanlozano@google.com> | 2017-12-21 06:42:55 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-12-21 06:42:55 +0000 |
commit | 9ddf491492d6bd430199639e4bc2440f963e0268 (patch) | |
tree | 5bf5a117866e458f0c2c5eb7a17c9d7249a948f9 /bootstat | |
parent | 3b7998aaa1a7f5050021c3d718e1f8c501d32b5a (diff) | |
parent | 44d3cacfce3054d395e47dced8c552dba1133b5c (diff) | |
download | system_core-9ddf491492d6bd430199639e4bc2440f963e0268.tar.gz system_core-9ddf491492d6bd430199639e4bc2440f963e0268.tar.bz2 system_core-9ddf491492d6bd430199639e4bc2440f963e0268.zip |
Merge "Fix sanitizer errors in bootstat.cpp."
Diffstat (limited to 'bootstat')
-rw-r--r-- | bootstat/bootstat.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bootstat/bootstat.cpp b/bootstat/bootstat.cpp index f81206a18..a1fcad8f2 100644 --- a/bootstat/bootstat.cpp +++ b/bootstat/bootstat.cpp @@ -429,9 +429,11 @@ class pstoreConsole { 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; } |