Commit d42294fc authored by Peter Eisentraut's avatar Peter Eisentraut

Fix compiler warning

from gcc-7 -Wformat-truncation (via -Wall)
parent be87b70b
......@@ -1009,12 +1009,12 @@ static char *
pretty_wal_size(int segment_count)
{
int sz = wal_segment_size_mb * segment_count;
char *result = pg_malloc(10);
char *result = pg_malloc(11);
if ((sz % 1024) == 0)
snprintf(result, 10, "%dGB", sz / 1024);
snprintf(result, 11, "%dGB", sz / 1024);
else
snprintf(result, 10, "%dMB", sz);
snprintf(result, 11, "%dMB", sz);
return result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment