Fix special case for C2x strtol binary constant handling (BZ# 30371)
commit95c9a6e806226cbf174c92efc021a0d464f170a4
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 25 May 2023 11:14:37 +0000 (25 08:14 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 25 May 2023 12:28:23 +0000 (25 09:28 -0300)
tree0a02ebbc928a183e2328c265494b1915f5b658b8
parente0189b25403f8b67e7a5513d6c33fb09cb2e5e20
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>
stdlib/strtol_l.c
stdlib/tst-strtol-binary-c11.c
stdlib/tst-strtol-binary-c2x.c
stdlib/tst-strtol-binary-gnu11.c
stdlib/tst-strtol-binary-gnu2x.c
stdlib/tst-strtol-binary-main.c
wcsmbs/tst-wcstol-binary-c11.c
wcsmbs/tst-wcstol-binary-c2x.c
wcsmbs/tst-wcstol-binary-gnu11.c
wcsmbs/tst-wcstol-binary-gnu2x.c