]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal: fix json output of unicode characters 992/head
authorDaniel Mack <daniel@zonque.org>
Tue, 18 Aug 2015 14:26:11 +0000 (16:26 +0200)
committerDaniel Mack <daniel@zonque.org>
Tue, 18 Aug 2015 14:26:11 +0000 (16:26 +0200)
src/shared/logs-show.c

index b78cb7678c458ac8280fbb26ab07382459473640..60144ab8a6775b2f02d275baf2b66428093ed8cd 100644 (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);