Skip to content

Commit 5969ba5

Browse files
committed
json: unicode chars don't need 64-bit ints
Signed-off-by: Josef 'Jeff' Sipek <[email protected]>
1 parent 462a1bd commit 5969ba5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fmt_json.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ int json_pack_int(struct buffer *buffer, int64_t v)
5050
return json_pack_uint(buffer, v);
5151
}
5252

53-
static int __escape_char(struct buffer *buffer, uint64_t c)
53+
static int __escape_char(struct buffer *buffer, uint32_t c)
5454
{
5555
char tmp[7];
5656

5757
/* FIXME: char outside of basic multilingual plane */
5858
if (c > 0xffff)
5959
return -ENOTSUP;
6060

61-
snprintf(tmp, sizeof(tmp), "\\u%04"PRIX64, c);
61+
snprintf(tmp, sizeof(tmp), "\\u%04X", c);
6262

6363
return buffer_append_cstr(buffer, tmp);
6464
}

0 commit comments

Comments
 (0)