From 5233d6b54dbae48b7604a3dedaee493a64d31cbf Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Thu, 4 Feb 2010 13:07:43 +0100 Subject: [PATCH] src/utils_format_json.c: Use "isfinite" rather than "isinf". Makes it a bit easier to read. --- src/utils_format_json.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils_format_json.c b/src/utils_format_json.c index dda2234f..75a73aee 100644 --- a/src/utils_format_json.c +++ b/src/utils_format_json.c @@ -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); -- 2.30.2