]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal: fix bisection algorithm
authorLennart Poettering <lennart@poettering.net>
Sun, 19 Aug 2012 13:16:32 +0000 (15:16 +0200)
committerLennart Poettering <lennart@poettering.net>
Sun, 19 Aug 2012 13:16:32 +0000 (15:16 +0200)
src/journal/journal-verify.c

index 535b2727acb947e1889469e2264cce7553b40524..e3c3ccdb20ba667f683671225136dc199872ab5a 100644 (file)
@@ -266,10 +266,14 @@ static int contains_uint64(MMapCache *m, int fd, uint64_t n, uint64_t p) {
                 if (*z == p)
                         return 1;
 
+                if (a + 1 >= b)
+                        return 0;
+
                 if (p < *z)
                         b = c;
-                else
+                else {
                         a = c;
+                }
         }
 
         return 0;