chiark / gitweb /
build-sys: make test output a bit nicer
[elogind.git] / src / journal / journal-file.c
index 48fdb6163aec5a1989dd4186d2d33483db56455f..121b40a58324a46064f605d718de78b2cfb30091 100644 (file)
@@ -1010,7 +1010,10 @@ static int journal_file_append_data(
         if (r < 0)
                 return r;
 
-        eq = memchr(data, '=', size);
+        if (!data)
+                eq = NULL;
+        else
+                eq = memchr(data, '=', size);
         if (eq && eq > data) {
                 uint64_t fp;
                 Object *fo;
@@ -1625,8 +1628,6 @@ static int generic_array_bisect(
                                         else
                                                 left = y + 1;
                                 }
-
-                                last_index = (uint64_t) -1;
                         }
 
                         for (;;) {
@@ -2695,10 +2696,10 @@ int journal_file_open_reliably(
         /* The file is corrupted. Rotate it away and try it again (but only once) */
 
         l = strlen(fname);
-        if (asprintf(&p, "%.*s@%016llx-%016llx.journal~",
+        if (asprintf(&p, "%.*s@%016llx-%016" PRIx64 ".journal~",
                      (int) l - 8, fname,
                      (unsigned long long) now(CLOCK_REALTIME),
-                     random_ull()) < 0)
+                     random_u64()) < 0)
                 return -ENOMEM;
 
         r = rename(fname, p);