From e7477788b7ca418590f8dd741e3ead6817814aa6 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Tue, 3 Oct 2023 10:16:01 +0200 Subject: [PATCH] mcel: Fix compilation error in tests. * lib/mcel.h (mcel_scan): Undefine 'mbs' after use. --- ChangeLog | 5 +++++ lib/mcel.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 14892c7f71..38e339b6c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2023-10-03 Bruno Haible + + mcel: Fix compilation error in tests. + * lib/mcel.h (mcel_scan): Undefine 'mbs' after use. + 2023-10-02 Bruno Haible localename, gettext: Avoid crash on macOS 14. diff --git a/lib/mcel.h b/lib/mcel.h index 54ae125957..b178c7aec9 100644 --- a/lib/mcel.h +++ b/lib/mcel.h @@ -249,6 +249,8 @@ mcel_scan (char const *p, char const *lim) char32_t ch; size_t len = mbrtoc32 (&ch, p, lim - p, &mbs); +#undef mbs + /* Any LEN with top bit set is an encoding error, as LEN == (size_t) -3 is not supported and MB_LEN_MAX is small. */ if (_GL_UNLIKELY ((size_t) -1 / 2 < len)) -- 2.39.5