From 7ff4854c7dcf3a8114e9a9a6030433bb03f2864a Mon Sep 17 00:00:00 2001 From: Niklas Claesson Date: Tue, 29 Oct 2019 08:02:32 +0100 Subject: [PATCH] json: Change error code type to integer The stricter json generation changed the type of the error code from number to string unintentionally. This changes it back. --- src/json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/json.c b/src/json.c index b9523797..bab088bc 100644 --- a/src/json.c +++ b/src/json.c @@ -80,7 +80,7 @@ int json_format_error(char *out, size_t len, const char *cmd, const char *msg, i GEN_CHECK(yajl_gen_string(g, (const uint8_t *)"message", sizeof("message") - 1), g); GEN_CHECK(yajl_gen_string(g, (const uint8_t *)msg, strlens(msg)), g); GEN_CHECK(yajl_gen_string(g, (const uint8_t *)"code", sizeof("code") - 1), g); - GEN_CHECK(yajl_gen_string(g, (const uint8_t *)flag_code(flag), strlens(flag_code(flag))), + GEN_CHECK(yajl_gen_number(g, flag_code(flag), strlens(flag_code(flag))), g); GEN_CHECK(yajl_gen_string(g, (const uint8_t *)"command", sizeof("command") - 1), g); GEN_CHECK(yajl_gen_string(g, (const uint8_t *)cmd, strlens(cmd)), g);