diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-05-17 10:04:24 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-05-31 13:04:18 +0200 |
commit | b778252b4ab9b2a1ea6d01cab3057308e9af1f60 (patch) | |
tree | bdfc42d8a1d93a9afe630a1fc8c50acd83ac08f0 /src/basic/journal-importer.c | |
parent | e743ce7053bdeb0b15220f7d842eb48d6721e48b (diff) | |
download | systemd-b778252b4ab9b2a1ea6d01cab3057308e9af1f60.tar.gz |
basic/journal-importer: do not write non-unicode char to log
The type of cescape_char() is changed to int to make it easier to use
in "%.*s". We know the value is between 1 and 4, so size_t is overkill.
Diffstat (limited to 'src/basic/journal-importer.c')
-rw-r--r-- | src/basic/journal-importer.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/basic/journal-importer.c b/src/basic/journal-importer.c index 0c7716717f..81044b85fb 100644 --- a/src/basic/journal-importer.c +++ b/src/basic/journal-importer.c @@ -9,6 +9,7 @@ #include <unistd.h> #include "alloc-util.h" +#include "escape.h" #include "fd-util.h" #include "io-util.h" #include "journal-file.h" @@ -233,7 +234,11 @@ static int get_data_newline(JournalImporter *imp) { assert(data); if (*data != '\n') { - log_error("expected newline, got '%c'", *data); + char buf[4]; + int l; + + l = cescape_char(*data, buf); + log_error("Expected newline, got '%.*s'", l, buf); return -EINVAL; } |