From dc6985f9d2d8625ac54717d698cae8af1a53d21b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 9 Mar 2022 16:28:44 +0100 Subject: [PATCH] Avoid bogus -Wmaybe-uninitialized from gcc 11 It doesn't really matter that number_buf is not initialized because its first characters are not going to be used anyhow (png_format_number() returns a pointer to the actually used part of the string at the end), but gcc-11 warns about it, so do initialize it just to make it happy. --- png.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/png.c b/png.c index 757c755f9..a076ba7b6 100644 --- a/png.c +++ b/png.c @@ -752,7 +752,7 @@ png_convert_to_rfc1123_buffer(char out[29], png_const_timep ptime) { size_t pos = 0; - char number_buf[5]; /* enough for a four-digit year */ + char number_buf[5] = {0}; /* enough for a four-digit year */ # define APPEND_STRING(string) pos = png_safecat(out, 29, pos, (string)) # define APPEND_NUMBER(format, value)\