1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-07 06:43:00 +03:00

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>
This commit is contained in:
Adhemerval Zanella
2023-05-25 08:14:37 -03:00
parent e0189b2540
commit 95c9a6e806
10 changed files with 65 additions and 39 deletions

View File

@@ -25,6 +25,7 @@
#define __GLIBC_USE_C2X_STRTOL 0
#define CHAR char
#define WIDE 0
#define FNPFX strto
#define L_(C) C
#define TEST_C2X 0