src/utils_format_json.c: Use "isfinite" rather than "isinf".
authorFlorian Forster <octo@huhu.verplant.org>
Thu, 4 Feb 2010 12:07:43 +0000 (13:07 +0100)
committerFlorian Forster <octo@huhu.verplant.org>
Thu, 4 Feb 2010 12:07:43 +0000 (13:07 +0100)
Makes it a bit easier to read.

src/utils_format_json.c

index dda2234..75a73ae 100644 (file)
@@ -99,10 +99,10 @@ static int values_to_json (char *buffer, size_t buffer_size, /* {{{ */
 
     if (ds->ds[i].type == DS_TYPE_GAUGE)
     {
-      if(isnan(vl->values[i].gauge) || isinf(vl->values[i].gauge))
-        BUFFER_ADD ("null");
-      else
+      if(isfinite (vl->values[i].gauge))
         BUFFER_ADD ("%g", vl->values[i].gauge);
+      else
+        BUFFER_ADD ("null");
     }
     else if (ds->ds[i].type == DS_TYPE_COUNTER)
       BUFFER_ADD ("%llu", vl->values[i].counter);