From c6ed31276fe163b2463d32043e851eb52507edc6 Mon Sep 17 00:00:00 2001 From: t4th <tath@o2.pl> Date: Fri, 13 Dec 2024 14:58:15 +0100 Subject: [PATCH] Fix invalid double comparison. --- cJSON.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cJSON.c b/cJSON.c index d7c72363..7ee3cc4e 100644 --- a/cJSON.c +++ b/cJSON.c @@ -581,7 +581,7 @@ static cJSON_bool print_number(const cJSON * const item, printbuffer * const out { length = sprintf((char*)number_buffer, "null"); } - else if(d == (double)item->valueint) + else if(compare_double(d, (double)item->valueint)) { length = sprintf((char*)number_buffer, "%d", item->valueint); }