From: Pavel Rochnyack Date: Wed, 4 Jul 2018 04:33:04 +0000 (+0700) Subject: postgresql: Set correct value to 'interval' query parameter (bugfix) X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=adc792f3ef14550fedcf2b3d160102fd6db69dfc;p=collectd.git postgresql: Set correct value to 'interval' query parameter (bugfix) --- diff --git a/src/postgresql.c b/src/postgresql.c index 7c140e0a..f1c7d7e6 100644 --- a/src/postgresql.c +++ b/src/postgresql.c @@ -430,9 +430,9 @@ static PGresult *c_psql_exec_query_params(c_psql_database_t *db, udb_query_t *q, params[i] = db->user; break; case C_PSQL_PARAM_INTERVAL: - snprintf(interval, sizeof(interval), "%.3f", - (db->interval > 0) ? CDTIME_T_TO_DOUBLE(db->interval) - : plugin_get_interval()); + ; + cdtime_t tmp = (db->interval > 0) ? db->interval : plugin_get_interval(); + snprintf(interval, sizeof(interval), "%.3f", CDTIME_T_TO_DOUBLE(tmp)); params[i] = interval; break; case C_PSQL_PARAM_INSTANCE: