summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bootstat/bootstat.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/bootstat/bootstat.cpp b/bootstat/bootstat.cpp
index b19ab781f..23c7d5dfc 100644
--- a/bootstat/bootstat.cpp
+++ b/bootstat/bootstat.cpp
@@ -432,9 +432,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;
}