From 3ea491c0a603f50ca0fb2505badd332fbd141f75 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Sat, 5 Nov 2016 21:26:18 +0700 Subject: [PATCH] Fix #26: Use long double literal for 1e60 Big thanks at mvollmer (https://sourceforge.net/p/cjson/bugs/45/) --- cJSON.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cJSON.c b/cJSON.c index f6d48a5..f1c9f4d 100644 --- a/cJSON.c +++ b/cJSON.c @@ -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); } -- GitLab