浏览代码

Fix #26: Use long double literal for 1e60

Big thanks at mvollmer (https://sourceforge.net/p/cjson/bugs/45/)
Max Bruckner 8 年之前
父节点
当前提交
3ea491c0a6
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      cJSON.c

+ 1 - 1
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);
             }