chiark / gitweb /
journal: fix seeking by realtime/seqnum
authorLennart Poettering <lennart@poettering.net>
Thu, 12 Jul 2012 15:36:51 +0000 (17:36 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 12 Jul 2012 22:32:32 +0000 (00:32 +0200)
src/journal/journal-file.c

index 83f603a..9665a05 100644 (file)
@@ -1611,8 +1611,10 @@ int journal_file_move_to_entry_by_seqnum_for_data(
         Object *d;
         int r;
 
+        assert(f);
+
         r = journal_file_move_to_object(f, OBJECT_DATA, data_offset, &d);
-        if (r <= 0)
+        if (r < 0)
                 return r;
 
         return generic_array_bisect_plus_one(f,
@@ -1635,8 +1637,10 @@ int journal_file_move_to_entry_by_realtime_for_data(
         Object *d;
         int r;
 
+        assert(f);
+
         r = journal_file_move_to_object(f, OBJECT_DATA, data_offset, &d);
-        if (r <= 0)
+        if (r < 0)
                 return r;
 
         return generic_array_bisect_plus_one(f,