changeset 750:577f448cfb45

json: unicode chars don't need 64-bit ints Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Tue, 02 Apr 2019 13:18:45 +0300
parents 869264dad80b
children 4e141f41f8f1
files fmt_json.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/fmt_json.c	Tue Apr 09 11:21:21 2019 -0400
+++ b/fmt_json.c	Tue Apr 02 13:18:45 2019 +0300
@@ -50,7 +50,7 @@
 	return json_pack_uint(buffer, v);
 }
 
-static int __escape_char(struct buffer *buffer, uint64_t c)
+static int __escape_char(struct buffer *buffer, uint32_t c)
 {
 	char tmp[7];
 
@@ -58,7 +58,7 @@
 	if (c > 0xffff)
 		return -ENOTSUP;
 
-	snprintf(tmp, sizeof(tmp), "\\u%04"PRIX64, c);
+	snprintf(tmp, sizeof(tmp), "\\u%04X", c);
 
 	return buffer_append_cstr(buffer, tmp);
 }