This commit is contained in:
xdars 2023-07-09 18:16:57 +08:00 committed by GitHub
commit f474d8a660
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -362,10 +362,12 @@ loop_end:
if (number >= INT_MAX)
{
item->valueint = INT_MAX;
item->valuelong = (long)strtol((const char *)number_c_string, (char **)NULL, 10);
}
else if (number <= (double)INT_MIN)
{
item->valueint = INT_MIN;
item->valuelong = (long)strtol((const char *)number_c_string, (char **)NULL, 10);
}
else
{

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;