From: Bruno Haible Date: Mon, 13 Jul 2026 23:11:27 +0000 (+0200) Subject: vasnwprintf: Fix test failure on NetBSD. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=71801d72c71b6ae706d06a3a9fcb9c2ab1b4e5b4;p=thirdparty%2Fgnulib.git vasnwprintf: Fix test failure on NetBSD. * lib/vasnprintf.c (THOUSEP_MAXLEN): Correct value. --- diff --git a/ChangeLog b/ChangeLog index b9dffc6ac2..572cef3c98 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2026-07-13 Bruno Haible + + vasnwprintf: Fix test failure on NetBSD. + * lib/vasnprintf.c (THOUSEP_MAXLEN): Correct value. + 2026-07-13 Bruno Haible vaszprintf-extra-tests: New module. diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index 63e59562b4..dd54b29427 100644 --- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -576,13 +576,6 @@ thousands_separator_wchar (wchar_t stackbuf[10]) 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 @@ -1887,6 +1880,15 @@ is_borderline (const char *digits, size_t precision) #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'