Skip to content

Commit d42294f

Browse files
committed
Fix compiler warning
from gcc-7 -Wformat-truncation (via -Wall)
1 parent be87b70 commit d42294f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bin/initdb/initdb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,12 +1009,12 @@ static char *
10091009
pretty_wal_size(int segment_count)
10101010
{
10111011
int sz = wal_segment_size_mb * segment_count;
1012-
char *result = pg_malloc(10);
1012+
char *result = pg_malloc(11);
10131013

10141014
if ((sz % 1024) == 0)
1015-
snprintf(result, 10, "%dGB", sz / 1024);
1015+
snprintf(result, 11, "%dGB", sz / 1024);
10161016
else
1017-
snprintf(result, 10, "%dMB", sz);
1017+
snprintf(result, 11, "%dMB", sz);
10181018

10191019
return result;
10201020
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy