chiark / gitweb /
journal: fix compiler warning in journal_file_append_data()
authorDaniel Mack <zonque@gmail.com>
Thu, 20 Feb 2014 16:24:36 +0000 (17:24 +0100)
committerDaniel Mack <zonque@gmail.com>
Thu, 20 Feb 2014 16:24:36 +0000 (17:24 +0100)
gcc (4.8.2, arm) does not understand that journal_file_append_field()
will always set 'fo' when it returns 0, so this warning is bogus.

Anyway, fix it by initialiting fo = NULL.

src/journal/journal-file.c

index 3a081110b98a74cccebe6fb303302b0d02e22eb5..23c4d28e730482ff715085beb6bfe03338c61510 100644 (file)
@@ -1012,8 +1012,8 @@ static int journal_file_append_data(
         else
                 eq = memchr(data, '=', size);
         if (eq && eq > data) {
         else
                 eq = memchr(data, '=', size);
         if (eq && eq > data) {
+                Object *fo = NULL;
                 uint64_t fp;
                 uint64_t fp;
-                Object *fo;
 
                 /* Create field object ... */
                 r = journal_file_append_field(f, data, (uint8_t*) eq - (uint8_t*) data, &fo, &fp);
 
                 /* Create field object ... */
                 r = journal_file_append_field(f, data, (uint8_t*) eq - (uint8_t*) data, &fo, &fp);