blobmsg_json: fix int16 serialization
authorPetr Štetiar <ynezz@true.cz>
Sun, 12 Jan 2020 21:40:18 +0000 (22:40 +0100)
committerPetr Štetiar <ynezz@true.cz>
Mon, 20 Jan 2020 15:15:34 +0000 (16:15 +0100)
commitf0da3a4283b7d1192de5c7e620df9381cd5a724b
tree1ed2370925a996b59d3f9701881517a61f00f3e6
parent20a070f0813972a16b7d01586beced58a0828742
blobmsg_json: fix int16 serialization

int16 blobmsg type is currently being serialized as uint16_t due to
missing cast during JSON output.

Following blobmsg content:

 bar-min: -32768 (i16)
 bar-max: 32767 (i16)

Produces following JSON:

 { "bar-min":32768,"bar-max":32767 }

Whereas one would expect:

 { "bar-min":-32768,"bar-max":32767 }

Reviewed-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
blobmsg_json.c
tests/cram/test_blobmsg.t