summaryrefslogtreecommitdiff
path: root/src/shared/json.c
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2022-08-30 09:28:56 +0200
committerJan Janssen <medhefgo@web.de>2022-08-30 12:03:33 +0200
commit5570a09702b2a4c77772617d5fce97b6b70ec03f (patch)
tree6894fe53f7ed84cce0f20d1190648e0797ca8023 /src/shared/json.c
parent2676befc73b3f40974ddad84972e873e5b826262 (diff)
downloadsystemd-5570a09702b2a4c77772617d5fce97b6b70ec03f.tar.gz
tree-wide: Fix format specifier warnings for %x
Unfortunately, hex output can only be produced with unsigned types. Some cases can be fixed by producing the correct type, but a few simply have to be cast. At least casting makes it explicit.
Diffstat (limited to 'src/shared/json.c')
-rw-r--r--src/shared/json.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/json.c b/src/shared/json.c
index 919f7f79db..f0416e66dc 100644
--- a/src/shared/json.c
+++ b/src/shared/json.c
@@ -1512,7 +1512,7 @@ static void json_format_string(FILE *f, const char *q, JsonFormatFlags flags) {
default:
if ((signed char) *q >= 0 && *q < ' ')
- fprintf(f, "\\u%04x", *q);
+ fprintf(f, "\\u%04x", (unsigned) *q);
else
fputc(*q, f);
break;