gdatetime: Fix a maybe-uninitialized warning

scan-build thinks that `tmp` can be dereferenced before it’s all been
assigned to. I don’t think that’s the case, because the number of
elements in it which have been assigned to is tracked as `i`. But static
analysers find that kind of state tracking hard to reason about, so
let’s just zero-initialise the array to simplify things.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #1767
This commit is contained in:
Philip Withnall 2024-04-12 15:56:07 +01:00
parent f1d5a71bbc
commit 057f0fcbfb
No known key found for this signature in database
GPG Key ID: DCDF5885B1F3ED73

View File

@ -3104,7 +3104,7 @@ format_number (GString *str,
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
};
const gchar * const *digits = ascii_digits;
const gchar *tmp[10];
const gchar *tmp[10] = { '\0', };
gint i = 0;
#ifdef HAVE_LANGINFO_OUTDIGIT
static GMutex alt_digits_mutex;