mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
Add long value support
Some APIs like Telegram Bot API return responses with values that cannot be accepted with simple valueint. parse_number() function doesn't actually accept numbers larger than INT_MAX/INT_MIN - if the number is one of those (i.e larger than INT_MAX - integer overflow), the result of "item->valueint" will be INT_MAX. In case overflow, let it try storing the value anyways.
This commit is contained in:
parent
2d4ad84192
commit
41c3ddf87c
1
cJSON.h
1
cJSON.h
@ -115,6 +115,7 @@ typedef struct cJSON
|
|||||||
char *valuestring;
|
char *valuestring;
|
||||||
/* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */
|
/* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */
|
||||||
int valueint;
|
int valueint;
|
||||||
|
long valuelong;
|
||||||
/* The item's number, if type==cJSON_Number */
|
/* The item's number, if type==cJSON_Number */
|
||||||
double valuedouble;
|
double valuedouble;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user