From eecfcf6c4a9245c08d011fc9caa4b98d7578b0ca Mon Sep 17 00:00:00 2001 From: Pierre-Noel Bouteville Date: Sun, 2 Jun 2024 12:26:15 +0200 Subject: [PATCH] to avoid gcc -Werror=float-equal error --- cJSON.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cJSON.c b/cJSON.c index cac1164b..c0866903 100644 --- a/cJSON.c +++ b/cJSON.c @@ -570,7 +570,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); }