From: Florian Forster Date: Mon, 6 Jul 2009 16:15:47 +0000 (+0200) Subject: src/utils_threshold.c: Add a percent sign to the minimum value, too. X-Git-Tag: collectd-4.8.0~83 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=79dee3a21d6aaca1b06ea65673dff858538f2ba6;p=collectd.git src/utils_threshold.c: Add a percent sign to the minimum value, too. --- diff --git a/src/utils_threshold.c b/src/utils_threshold.c index 083a0185..16f9bd2e 100644 --- a/src/utils_threshold.c +++ b/src/utils_threshold.c @@ -664,12 +664,12 @@ static int ut_report_state (const data_set_t *ds, { if (!isnan (min) && !isnan (max)) { - status = ssnprintf (buf, bufsize, ": Data source \"%s\" is currently " - "%f. That is within the %s region of %f and %f%s.", - ds->ds[ds_index].name, values[ds_index], - (state == STATE_ERROR) ? "failure" : "warning", - min, max, - ((th->flags & UT_FLAG_PERCENTAGE) == UT_FLAG_PERCENTAGE) ? "%" : "" ); + status = ssnprintf (buf, bufsize, ": Data source \"%s\" is currently " + "%f. That is within the %s region of %f%s and %f%s.", + ds->ds[ds_index].name, values[ds_index], + (state == STATE_ERROR) ? "failure" : "warning", + min, ((th->flags & UT_FLAG_PERCENTAGE) != 0) ? "%" : "", + max, ((th->flags & UT_FLAG_PERCENTAGE) != 0) ? "%" : ""); } else { @@ -679,7 +679,7 @@ static int ut_report_state (const data_set_t *ds, isnan (min) ? "below" : "above", (state == STATE_ERROR) ? "failure" : "warning", isnan (min) ? max : min, - ((th->flags & UT_FLAG_PERCENTAGE) == UT_FLAG_PERCENTAGE) ? "%" : "" ); + ((th->flags & UT_FLAG_PERCENTAGE) != 0) ? "%" : ""); } } else /* is not inverted */ @@ -690,7 +690,7 @@ static int ut_report_state (const data_set_t *ds, (values[ds_index] < min) ? "below" : "above", (state == STATE_ERROR) ? "failure" : "warning", (values[ds_index] < min) ? min : max, - ((th->flags & UT_FLAG_PERCENTAGE) == UT_FLAG_PERCENTAGE) ? "%" : "" ); + ((th->flags & UT_FLAG_PERCENTAGE) != 0) ? "%" : ""); } buf += status; bufsize -= status; @@ -950,4 +950,4 @@ int ut_check_interesting (const char *name) return (2); } /* }}} int ut_check_interesting */ -/* vim: set sw=2 ts=8 sts=2 tw=78 fdm=marker : */ +/* vim: set sw=2 ts=8 sts=2 tw=78 et fdm=marker : */