diff options
author | Jo-Philipp Wich <jo@mein.io> | 2021-09-23 18:45:48 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2021-09-23 18:45:48 +0200 |
commit | e43b751aab997c5e74a0712f7569d90bd3d6b429 (patch) | |
tree | 367392c59f9a8bc017e8446ba6330e76fd6b3f8a /lib/ubus.c | |
parent | acd3c7691bda056d367adb18a62bf61eaea016db (diff) |
ubus: fix handling signed 16bit and 32bit integers
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lib/ubus.c')
-rw-r--r-- | lib/ubus.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -96,10 +96,10 @@ uc_blob_to_json(uc_vm_t *vm, struct blob_attr *attr, bool table, const char **na return ucv_boolean_new(*(uint8_t *)data); case BLOBMSG_TYPE_INT16: - return ucv_int64_new((int64_t)be16_to_cpu(*(uint16_t *)data)); + return ucv_int64_new((int16_t)be16_to_cpu(*(uint16_t *)data)); case BLOBMSG_TYPE_INT32: - return ucv_int64_new((int64_t)be32_to_cpu(*(uint32_t *)data)); + return ucv_int64_new((int32_t)be32_to_cpu(*(uint32_t *)data)); case BLOBMSG_TYPE_INT64: return ucv_uint64_new(be64_to_cpu(*(uint64_t *)data)); |