From: Florian Forster Date: Thu, 4 Feb 2010 12:07:43 +0000 (+0100) Subject: src/utils_format_json.c: Use "isfinite" rather than "isinf". X-Git-Tag: collectd-4.8.4~26 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=5233d6b54dbae48b7604a3dedaee493a64d31cbf;p=collectd.git src/utils_format_json.c: Use "isfinite" rather than "isinf". Makes it a bit easier to read. --- 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);