diff options
author | jacopo grandi <jak.sk8@hotmail.it> | 2021-02-24 18:01:08 +0100 |
---|---|---|
committer | jacopo grandi <jak.sk8@hotmail.it> | 2021-02-24 18:01:08 +0100 |
commit | dad432566a5c74f86dc4ba874e631115e0f469d1 (patch) | |
tree | 0e282e874ef48658d87e82041afe7bba1db3704a /json | |
parent | 0b338bbd007048551526ab4fa4130d53b414e650 (diff) |
level selector and fx fic
Diffstat (limited to 'json')
-rw-r--r-- | json/jsonparse.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/json/jsonparse.c b/json/jsonparse.c index 9ac845c..4b5096c 100644 --- a/json/jsonparse.c +++ b/json/jsonparse.c @@ -15,11 +15,11 @@ void json_parse_array(char *json, void *temp, jsmntok_t *t, int r, char type) { if (t[i].type == JSMN_PRIMITIVE) { char val[32]; substr_token(json, val, t+i); if (type == 'i') { - int *p = (int*)(intptr_t)temp+sizeof(int)*i; + int *p = (int*)(intptr_t)temp+i; *p = atoi(val); } if (type == 'c') { - int8_t *p = (int8_t*)(intptr_t)temp+sizeof(int8_t)*i; + int8_t *p = (int8_t*)(intptr_t)temp+i; *p = atoi(val); } if (type == 'f') { @@ -35,7 +35,7 @@ void json_dump_array (char *str, void *arr, int len, char type) { sprintf(str+cur, "[ "); cur = strlen(str); for (int i=0; i<len; i++) { if (type == 'i') { - sprintf(str+cur, "%d", (int)(intptr_t)(arr+i*sizeof(int))); + sprintf(str+cur, "%d", ((int)(intptr_t)(arr))[i]); cur = strlen(str); } if (type == 'c') { |