mirror of
https://github.com/AuxXxilium/eudev.git
synced 2024-11-23 23:10:57 +07:00
logs-show: fix off-by-one error
Ellipsize lines that are one character too long.
This commit is contained in:
parent
871b876ecc
commit
193556b69e
@ -246,7 +246,7 @@ static int output_short(sd_journal *j, unsigned line, unsigned n_columns,
|
|||||||
char bytes[FORMAT_BYTES_MAX];
|
char bytes[FORMAT_BYTES_MAX];
|
||||||
printf(": [%s blob data]\n", format_bytes(bytes, sizeof(bytes), message_len));
|
printf(": [%s blob data]\n", format_bytes(bytes, sizeof(bytes), message_len));
|
||||||
} else if ((flags & OUTPUT_FULL_WIDTH) ||
|
} else if ((flags & OUTPUT_FULL_WIDTH) ||
|
||||||
(message_len + n < n_columns))
|
(message_len + n + 1 < n_columns))
|
||||||
printf(": %s%.*s%s\n", color_on, (int) message_len, message, color_off);
|
printf(": %s%.*s%s\n", color_on, (int) message_len, message, color_off);
|
||||||
else if (n < n_columns && n_columns - n - 2 >= 3) {
|
else if (n < n_columns && n_columns - n - 2 >= 3) {
|
||||||
char *e;
|
char *e;
|
||||||
|
Loading…
Reference in New Issue
Block a user