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:
ion 2020-01-13 15:53:42 +02:00 committed by GitHub
parent 2d4ad84192
commit 41c3ddf87c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,6 +115,7 @@ typedef struct cJSON
char *valuestring;
/* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */
int valueint;
long valuelong;
/* The item's number, if type==cJSON_Number */
double valuedouble;