Skip to content

Commit 2765b7b

Browse files
committed
journalctl: print proper IDs with --header
The same buffer was used for two different IDs, messing up the output.
1 parent 507f22b commit 2765b7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/journal/journal-file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,7 +2271,7 @@ void journal_file_dump(JournalFile *f) {
22712271
}
22722272

22732273
void journal_file_print_header(JournalFile *f) {
2274-
char a[33], b[33], c[33];
2274+
char a[33], b[33], c[33], d[33];
22752275
char x[FORMAT_TIMESTAMP_MAX], y[FORMAT_TIMESTAMP_MAX];
22762276
struct stat st;
22772277
char bytes[FORMAT_BYTES_MAX];
@@ -2301,7 +2301,7 @@ void journal_file_print_header(JournalFile *f) {
23012301
sd_id128_to_string(f->header->file_id, a),
23022302
sd_id128_to_string(f->header->machine_id, b),
23032303
sd_id128_to_string(f->header->boot_id, c),
2304-
sd_id128_to_string(f->header->seqnum_id, c),
2304+
sd_id128_to_string(f->header->seqnum_id, d),
23052305
f->header->state == STATE_OFFLINE ? "OFFLINE" :
23062306
f->header->state == STATE_ONLINE ? "ONLINE" :
23072307
f->header->state == STATE_ARCHIVED ? "ARCHIVED" : "UNKNOWN",

0 commit comments

Comments
 (0)