chiark / gitweb /
journalctl: print proper IDs with --header
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 5 Jun 2013 22:40:44 +0000 (18:40 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 10 Jun 2013 14:10:07 +0000 (10:10 -0400)
The same buffer was used for two different IDs, messing up
the output.

src/journal/journal-file.c

index 3cb8f79947489948c083b6563072818bdf259385..7f855743b87a5f27bd1d6305fcb11dadde108729 100644 (file)
@@ -2271,7 +2271,7 @@ fail:
 }
 
 void journal_file_print_header(JournalFile *f) {
-        char a[33], b[33], c[33];
+        char a[33], b[33], c[33], d[33];
         char x[FORMAT_TIMESTAMP_MAX], y[FORMAT_TIMESTAMP_MAX];
         struct stat st;
         char bytes[FORMAT_BYTES_MAX];
@@ -2301,7 +2301,7 @@ void journal_file_print_header(JournalFile *f) {
                sd_id128_to_string(f->header->file_id, a),
                sd_id128_to_string(f->header->machine_id, b),
                sd_id128_to_string(f->header->boot_id, c),
-               sd_id128_to_string(f->header->seqnum_id, c),
+               sd_id128_to_string(f->header->seqnum_id, d),
                f->header->state == STATE_OFFLINE ? "OFFLINE" :
                f->header->state == STATE_ONLINE ? "ONLINE" :
                f->header->state == STATE_ARCHIVED ? "ARCHIVED" : "UNKNOWN",