chiark / gitweb /
journal: fix compiler warning in real_journal_next()
authorDaniel Mack <zonque@gmail.com>
Thu, 20 Feb 2014 16:21:13 +0000 (17:21 +0100)
committerDaniel Mack <zonque@gmail.com>
Thu, 20 Feb 2014 16:21:13 +0000 (17:21 +0100)
gcc (4.8.2, arm) does not understand that next_beyond_location() will
always set 'p' when it returns > 0. Initialize p in order to fix this.

src/journal/sd-journal.c

index 831ab6b4e9b28446812f05e02faf74a40519f096..3740a9a84035c1c5926371a3c503f27936d415dc 100644 (file)
@@ -871,9 +871,9 @@ static int next_beyond_location(sd_journal *j, JournalFile *f, direction_t direc
 static int real_journal_next(sd_journal *j, direction_t direction) {
         JournalFile *f, *new_file = NULL;
         uint64_t new_offset = 0;
-        Object *o;
-        uint64_t p;
+        uint64_t p = 0;
         Iterator i;
+        Object *o;
         int r;
 
         assert_return(j, -EINVAL);