diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2023-05-25 08:14:37 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2023-05-25 09:28:23 -0300 |
commit | 95c9a6e806226cbf174c92efc021a0d464f170a4 (patch) | |
tree | 0a02ebbc928a183e2328c265494b1915f5b658b8 /wcsmbs | |
parent | rtld: properly handle root directory in load path (bug 30435) (diff) | |
download | glibc-95c9a6e806226cbf174c92efc021a0d464f170a4.tar.gz glibc-95c9a6e806226cbf174c92efc021a0d464f170a4.tar.bz2 glibc-95c9a6e806226cbf174c92efc021a0d464f170a4.zip |
Fix special case for C2x strtol binary constant handling (BZ# 30371)
When the base is 0 or 2 and the first two characters are '0' and 'b',
but the rest are no binary digits. In this case this is no error,
and strtol must return 0 and ENDPTR points to the 'x' or 'b'.
Checked on x86_64-linux-gnu and i686-linux-gnu.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
Diffstat (limited to 'wcsmbs')
-rw-r--r-- | wcsmbs/tst-wcstol-binary-c11.c | 1 | ||||
-rw-r--r-- | wcsmbs/tst-wcstol-binary-c2x.c | 1 | ||||
-rw-r--r-- | wcsmbs/tst-wcstol-binary-gnu11.c | 1 | ||||
-rw-r--r-- | wcsmbs/tst-wcstol-binary-gnu2x.c | 1 |
4 files changed, 4 insertions, 0 deletions
diff --git a/wcsmbs/tst-wcstol-binary-c11.c b/wcsmbs/tst-wcstol-binary-c11.c index bff1d879f0..fdd79ec9e0 100644 --- a/wcsmbs/tst-wcstol-binary-c11.c +++ b/wcsmbs/tst-wcstol-binary-c11.c @@ -20,6 +20,7 @@ #undef _GNU_SOURCE #define CHAR wchar_t +#define WIDE 1 #define FNPFX wcsto #define L_(C) L ## C #define TEST_C2X 0 diff --git a/wcsmbs/tst-wcstol-binary-c2x.c b/wcsmbs/tst-wcstol-binary-c2x.c index 0f8ef44854..6c06dab9ba 100644 --- a/wcsmbs/tst-wcstol-binary-c2x.c +++ b/wcsmbs/tst-wcstol-binary-c2x.c @@ -23,6 +23,7 @@ #define _ISOC2X_SOURCE #define CHAR wchar_t +#define WIDE 1 #define FNPFX wcsto #define L_(C) L ## C #define TEST_C2X 1 diff --git a/wcsmbs/tst-wcstol-binary-gnu11.c b/wcsmbs/tst-wcstol-binary-gnu11.c index 189f217563..1a3d5d3d6c 100644 --- a/wcsmbs/tst-wcstol-binary-gnu11.c +++ b/wcsmbs/tst-wcstol-binary-gnu11.c @@ -25,6 +25,7 @@ #define __GLIBC_USE_C2X_STRTOL 0 #define CHAR wchar_t +#define WIDE 1 #define FNPFX wcsto #define L_(C) L ## C #define TEST_C2X 0 diff --git a/wcsmbs/tst-wcstol-binary-gnu2x.c b/wcsmbs/tst-wcstol-binary-gnu2x.c index 707d4076f1..feda1b59dd 100644 --- a/wcsmbs/tst-wcstol-binary-gnu2x.c +++ b/wcsmbs/tst-wcstol-binary-gnu2x.c @@ -18,6 +18,7 @@ <https://www.gnu.org/licenses/>. */ #define CHAR wchar_t +#define WIDE 1 #define FNPFX wcsto #define L_(C) L ## C #define TEST_C2X 1 |