summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-08-19 11:12:14 +0200
committerLennart Poettering <lennart@poettering.net>2015-08-19 11:12:14 +0200
commit561a0efdcb72bec897e9ac1792b5ea0d3f279582 (patch)
treee9a304eb410ae304ed0acb81441dffb769aad2d0
parent9a877fd409b91c43c301d293ad682a8454bcdbcf (diff)
parent91a8a108096164c9425e027a5876dfe51890f1e7 (diff)
Merge pull request #992 from zonque/journal-json
journal: fix json output of unicode characters
-rw-r--r--src/shared/logs-show.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
index b78cb7678c..60144ab8a6 100644
--- a/src/shared/logs-show.c
+++ b/src/shared/logs-show.c
@@ -575,7 +575,6 @@ void json_escape(
assert(p);
if (!(flags & OUTPUT_SHOW_ALL) && l >= JSON_THRESHOLD)
-
fputs("null", f);
else if (!utf8_is_printable(p, l)) {
@@ -605,8 +604,8 @@ void json_escape(
fputc(*p, f);
} else if (*p == '\n')
fputs("\\n", f);
- else if (*p < ' ')
- fprintf(f, "\\u%04x", *p);
+ else if ((uint8_t) *p < ' ')
+ fprintf(f, "\\u%04x", (uint8_t) *p);
else
fputc(*p, f);