diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-07-06 09:14:01 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-07-09 11:11:21 +0200 |
commit | 2b59bf51a0fcd98f4bd56b8c47ce50357cf65c9a (patch) | |
tree | a3734788e349fa3032290c6a850b3eecd44fb4c1 /src/shared/logs-show.c | |
parent | Inline some iterator variables (diff) | |
download | systemd-2b59bf51a0fcd98f4bd56b8c47ce50357cf65c9a.tar.xz systemd-2b59bf51a0fcd98f4bd56b8c47ce50357cf65c9a.zip |
tree-wide: add FORMAT_BYTES()
Diffstat (limited to 'src/shared/logs-show.c')
-rw-r--r-- | src/shared/logs-show.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c index e63c59bd94..3165cf29da 100644 --- a/src/shared/logs-show.c +++ b/src/shared/logs-show.c @@ -579,10 +579,9 @@ static int output_short( } } - if (!(flags & OUTPUT_SHOW_ALL) && !utf8_is_printable(message, message_len)) { - char bytes[FORMAT_BYTES_MAX]; - fprintf(f, "[%s blob data]\n", format_bytes(bytes, sizeof(bytes), message_len)); - } else { + if (!(flags & OUTPUT_SHOW_ALL) && !utf8_is_printable(message, message_len)) + fprintf(f, "[%s blob data]\n", FORMAT_BYTES(message_len)); + else { /* URLify config_file string in message, if the message starts with it. * Skip URLification if the highlighted pattern overlaps. */ @@ -726,16 +725,13 @@ static int output_verbose( p, valuelen, NULL); fputs(off, f); - } else { - char bytes[FORMAT_BYTES_MAX]; - + } else fprintf(f, " %s%.*s=[%s blob data]%s\n", on, (int) (c - (const char*) data), (const char*) data, - format_bytes(bytes, sizeof(bytes), length - (c - (const char *) data) - 1), + FORMAT_BYTES(length - (c - (const char *) data) - 1), off); - } } if (r < 0) |