Skip to content

Commit

Permalink
Fix #83
Browse files Browse the repository at this point in the history
  • Loading branch information
BlockoS committed May 19, 2024
1 parent 1d3fa28 commit 7588f61
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion jsonhelpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,14 @@
int json_validate_int(const json_t* obj, int* out) {
int ret = 0;
if(json_is_string(obj)) {
const char *str = json_string_value(obj);
for(; (*str!='\0') && isspace(*str); str++) {
}
if(*str=='$') {
str++;
}
errno = 0;
*out = strtoul(json_string_value(obj), NULL, 16);
*out = strtoul(str, NULL, 16);
if(errno == 0) {
ret = 1;
}
Expand Down

0 comments on commit 7588f61

Please sign in to comment.