]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
vasnwprintf: Fix test failure on NetBSD.
authorBruno Haible <bruno@clisp.org>
Mon, 13 Jul 2026 23:11:27 +0000 (01:11 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 13 Jul 2026 23:11:27 +0000 (01:11 +0200)
* lib/vasnprintf.c (THOUSEP_MAXLEN): Correct value.

ChangeLog
lib/vasnprintf.c

index b9dffc6ac2a7e11d6f198c401fb015850ad0437a..572cef3c9889462cfd3a98d7a78d9f426aa1f67c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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.
index 63e59562b446a8226e8920319e301670ce6d3a41..dd54b294279c438f0a242ddb032ee03621eac749 100644 (file)
@@ -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'