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.
This commit is contained in:
Vadim Zeitlin 2022-03-09 16:28:44 +01:00
parent 9853c67ab4
commit dc6985f9d2

2
png.c
View File

@ -752,7 +752,7 @@ png_convert_to_rfc1123_buffer(char out[29], png_const_timep ptime)
{ {
size_t pos = 0; 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_STRING(string) pos = png_safecat(out, 29, pos, (string))
# define APPEND_NUMBER(format, value)\ # define APPEND_NUMBER(format, value)\