cJSON

mirror of Dave's cJSON
git clone git://git.thc420.xyz/cJSON
Log | Files | Refs | README | LICENSE

commit 2fe50bd5577465ba2387b9b66d13df3b479b511d
parent 4488c2b5ad5a9f3d751d9ae5fa96e313a70f90c0
Author: Dave Gamble <davegamble@gmail.com>
Date:   Sun, 29 May 2016 16:19:05 +0100

get rid of isnormal test!!

Diffstat:
McJSON.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cJSON.c b/cJSON.c @@ -166,7 +166,7 @@ static char *print_number(cJSON *item,printbuffer *p) else str=(char*)cJSON_malloc(64); /* This is a nice tradeoff. */ if (str) { - if (!isnormal(d)) sprintf(str,"null"); + if (d*0!=0) sprintf(str,"null"); /* This checks for NaN and Infinity */ else if (fabs(floor(d)-d)<=DBL_EPSILON && fabs(d)<1.0e60) sprintf(str,"%.0f",d); else if (fabs(d)<1.0e-6 || fabs(d)>1.0e9) sprintf(str,"%e",d); else sprintf(str,"%f",d);