]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
mbrtowc: Fix handling of n==0 on CentOS 7, MSVC (regr. 2026-05-25).
authorBruno Haible <bruno@clisp.org>
Tue, 2 Jun 2026 12:14:09 +0000 (14:14 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 2 Jun 2026 12:14:09 +0000 (14:14 +0200)
* lib/mbrtowc.c (rpl_mbrtowc): Fix botched condition for the n==0 case.

ChangeLog
lib/mbrtowc.c

index f4e072e7cd1e1ffa9bd3288b0b6dcead449a905c..7f380c43ccf27eb34de84978261739aaf97527a4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2026-06-02  Bruno Haible  <bruno@clisp.org>
+
+       mbrtowc: Fix handling of n==0 on CentOS 7, MSVC (regr. 2026-05-25).
+       * lib/mbrtowc.c (rpl_mbrtowc): Fix botched condition for the n==0 case.
+
 2026-06-02  Bruno Haible  <bruno@clisp.org>
 
        mbrtowc, mbrlen: Work around a NetBSD bug in UTF-8 locales.
index 48316a068ae2189b9275fc2f880635fd30b26baa..116bb09fbd2a920385e2541669b7d0ef9e02b512 100644 (file)
@@ -120,7 +120,7 @@ rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
     }
 # endif
 
-# if (MBRTOC32_EMPTY_INPUT_BUG || MBRTOWC_INVALID_UTF8_BUG || _GL_SMALL_WCHAR_T \
+# if (MBRTOWC_EMPTY_INPUT_BUG || MBRTOWC_INVALID_UTF8_BUG \
       || (GNULIB_WCHAR_SINGLE_LOCALE && __GLIBC__ >= 2 && !__UCLIBC__))
   if (n == 0)
     return (size_t) -2;