From 9f1cf3629d6a264bbad93d01c2082837a7f6e34a Mon Sep 17 00:00:00 2001 From: Ibrar Ahmed Date: Tue, 3 Dec 2019 10:46:32 +0000 Subject: [PATCH] Issue - (#10): The hist_* is not working in CentOS. Remove some old code, missed previously. --- pg_stat_monitor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pg_stat_monitor.c b/pg_stat_monitor.c index 100b32098a34..c98571ba584f 100644 --- a/pg_stat_monitor.c +++ b/pg_stat_monitor.c @@ -3429,18 +3429,17 @@ array_get_datum(double arr[]) char tmp[10]; bool first = true; + memset(str, 0, 1024); /* Need to calculate the actual size, and avoid unnessary memory usage */ for (j = 0; j < 24; j++) { if (first) { - snprintf(str, 1024, "%s %04.1f", str, arr[j]); snprintf(tmp, 10, "%04.1f", arr[j]); strcat(str,tmp); first = false; continue; } - sprintf(str, "%s, %04.1f", str, arr[j]); snprintf(tmp, 10, ", %04.1f", arr[j]); strcat(str,tmp); }