#if TEST_SNPRINTF
#include <math.h> /* For pow(3), NAN, and INFINITY. */
-#include <string.h> /* For strcmp(3). */
#if defined(__NetBSD__) || \
defined(__FreeBSD__) || \
defined(__OpenBSD__) || \
#if !HAVE_SNPRINTF || !HAVE_VSNPRINTF
#include <stdio.h> /* For NULL, size_t, vsnprintf(3), and vasprintf(3). */
+#include <string.h> /* For strcmp(3) and memset(3). */
#ifdef VA_START
#undef VA_START
#endif /* defined(VA_START) */
struct lconv *lc = localeconv();
#endif /* HAVE_LOCALECONV && HAVE_LCONV_DECIMAL_POINT */
+ /* Initialize with memset because `var[n]={0}` is not supported by C90. */
+ memset(iconvert, '\0', MAX_CONVERT_LENGTH);
+ memset(fconvert, '\0', MAX_CONVERT_LENGTH);
+
/*
* AIX' man page says the default is 0, but C99 and at least Solaris'
* and NetBSD's man pages say the default is 6, and sprintf(3) on AIX