journalctl: print proper IDs with --header

The same buffer was used for two different IDs, messing up
the output.

(cherry picked from commit 2765b7bb69)
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2014-07-22 23:03:31 -04:00
parent 701ba7165d
commit f2caf835d3
+2 -2
View File
@@ -2273,7 +2273,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];
@@ -2303,7 +2303,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",