unformat_input_t input;
char *p = cJSON_GetStringValue(o);
unformat_init_string (&input, p, strlen(p));
- unformat(&input, "0x%U", unformat_hex_string, s);
+ if (!unformat (&input, "0x%U", unformat_hex_string, s))
+ return -1;
return 0;
}
char *p = cJSON_GetStringValue(item);
unformat_init_string (&input, p, strlen(p));
- unformat(&input, "0x%U", unformat_hex_string, &s);
+ if (!unformat (&input, "0x%U", unformat_hex_string, &s))
+ return 0;
return s;
}