1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 11:27:32 +03:00

journal: fix json output of unicode characters

This commit is contained in:
Daniel Mack 2015-08-18 16:26:11 +02:00
parent 9a877fd409
commit 91a8a10809

View File

@ -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);