If the `intval` obtained from `info` is indeed 0, it cannot be set to `conf`.
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15495
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
return NULL;
#define UPDATE_VAL(field, name) \
- if ((intval = ucv_int64_get(ucv_object_get(info, name, NULL))) && \
- !errno && intval != conf->field) do { \
- conf->field = intval; \
- changed = true; \
+ do { \
+ intval = ucv_int64_get(ucv_object_get(info, name, NULL)); \
+ if (!errno && intval != conf->field) { \
+ conf->field = intval; \
+ changed = true; \
+ } \
} while(0)
conf = iface->conf;