From: Florian Forster Date: Wed, 1 Jul 2009 14:58:52 +0000 (+0200) Subject: Various plugins: Fix formatstring errors. X-Git-Tag: collectd-4.8.0~88 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3f1def59ca8cd58cd5671535624d7c725a2d0445;p=collectd.git Various plugins: Fix formatstring errors. --- diff --git a/src/rrdcached.c b/src/rrdcached.c index 6295a53f..8755400b 100644 --- a/src/rrdcached.c +++ b/src/rrdcached.c @@ -88,15 +88,15 @@ static int value_list_to_string (char *buffer, int buffer_len, else if (ds->ds[i].type == DS_TYPE_GAUGE) { status = ssnprintf (buffer + offset, buffer_len - offset, - ":%lf", vl->values[i].gauge); + ":%f", vl->values[i].gauge); } else if (ds->ds[i].type == DS_TYPE_DERIVE) { status = ssnprintf (buffer + offset, buffer_len - offset, - ":%llu", vl->values[i].derive); + ":%"PRIi64, vl->values[i].derive); } else /* if (ds->ds[i].type == DS_TYPE_ABSOLUTE) */ { status = ssnprintf (buffer + offset, buffer_len - offset, - ":%llu", vl->values[i].absolute); + ":%"PRIu64, vl->values[i].absolute); } diff --git a/src/rrdtool.c b/src/rrdtool.c index a361501d..c63f883a 100644 --- a/src/rrdtool.c +++ b/src/rrdtool.c @@ -217,10 +217,10 @@ static int value_list_to_string (char *buffer, int buffer_len, ":%lf", vl->values[i].gauge); else if (ds->ds[i].type == DS_TYPE_DERIVE) status = ssnprintf (buffer + offset, buffer_len - offset, - ":%llu", vl->values[i].derive); + ":%"PRIi64, vl->values[i].derive); else /*if (ds->ds[i].type == DS_TYPE_ABSOLUTE) */ status = ssnprintf (buffer + offset, buffer_len - offset, - ":%llu", vl->values[i].absolute); + ":%"PRIu64, vl->values[i].absolute); if ((status < 1) || (status >= (buffer_len - offset))) return (-1); diff --git a/src/utils_rrdcreate.c b/src/utils_rrdcreate.c index 0abbb40b..4ecec59d 100644 --- a/src/utils_rrdcreate.c +++ b/src/utils_rrdcreate.c @@ -229,14 +229,14 @@ static int ds_get (char ***ret, /* {{{ */ sstrncpy (min, "U", sizeof (min)); } else - ssnprintf (min, sizeof (min), "%lf", d->min); + ssnprintf (min, sizeof (min), "%f", d->min); if (isnan (d->max)) { sstrncpy (max, "U", sizeof (max)); } else - ssnprintf (max, sizeof (max), "%lf", d->max); + ssnprintf (max, sizeof (max), "%f", d->max); status = ssnprintf (buffer, sizeof (buffer), "DS:%s:%s:%i:%s:%s",