[LEDE-DEV] [OpenWrt-Devel] [PATCH] blobmsg_json: handle conversion of large integers from JSON

Eyal Birger eyal.birger at gmail.com
Tue Oct 25 01:43:58 PDT 2016


Hi,

On Wed, Oct 19, 2016 at 1:10 PM, Florian Larysch <fl at n621.de> wrote:
> Currently, libubox uses json_object_get_int when converting a JSON
> document into a blobmsg. However, json-c stores integers as int64_t
> values and may clamp the value when asked to return it as an int32_t.
>
> Always use json_object_get_int64 and use a u32/u64 blobmsg value
> depending on the magnitude of the returned value.

This has been somewhat discussed in the past (see
https://lists.openwrt.org/pipermail/openwrt-devel/2016-June/041700.html).

IIUC, your change makes the type of fields vary upon their values.
I'm wondering how you suggest applications parse the resulting blob messages?

Eyal.



More information about the Lede-dev mailing list