1
0
mirror of https://github.com/DaveGamble/cJSON synced 2024-12-24 23:52:07 +00:00

Fix #26: Use long double literal for 1e60

Big thanks at mvollmer (https://sourceforge.net/p/cjson/bugs/45/)
This commit is contained in:
Max Bruckner 2016-11-05 21:26:18 +07:00
parent 050829f274
commit 3ea491c0a6

View File

@ -327,7 +327,7 @@ static char *print_number(const cJSON *item, printbuffer *p)
{
sprintf(str, "null");
}
else if ((fabs(floor(d) - d) <= DBL_EPSILON) && (fabs(d) < 1.0e60))
else if ((fabs(floor(d) - d) <= DBL_EPSILON) && (fabs(d) < 1.0e60L))
{
sprintf(str, "%.0f", d);
}