+2026-07-13 Bruno Haible <bruno@clisp.org>
+
+ vasnwprintf: Fix test failure on NetBSD.
+ * lib/vasnprintf.c (THOUSEP_MAXLEN): Correct value.
+
2026-07-13 Bruno Haible <bruno@clisp.org>
vaszprintf-extra-tests: New module.
separator. */
#define THOUSEP_WCHAR_MAXLEN 1
-/* Maximum number of units needed for a thousands separator. */
-#if WIDE_CHAR_VERSION
-# define THOUSEP_MAXLEN THOUSEP_WCHAR_MAXLEN
-#else
-# define THOUSEP_MAXLEN THOUSEP_CHAR_MAXLEN
-#endif
-
#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_LONG_DOUBLE) || (NEED_PRINTF_FLAG_ALT_PRECISION_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION || NEED_PRINTF_FLAG_GROUPING || NEED_PRINTF_FLAG_GROUPING_INT)
# ifndef grouping_rule_defined
# define grouping_rule_defined 1
#endif
+/* Maximum number of units needed for a thousands separator,
+ in the code that creates a temporary unit sequence of length
+ MAX_ROOM_NEEDED (...). */
+#if USE_SNPRINTF && (WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)
+# define THOUSEP_MAXLEN THOUSEP_WCHAR_MAXLEN
+#else
+# define THOUSEP_MAXLEN THOUSEP_CHAR_MAXLEN
+#endif
+
#if !USE_SNPRINTF || (WIDE_CHAR_VERSION && DCHAR_IS_TCHAR) || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF
/* Use a different function name, to make it possible that the 'wchar_t'