Re: [PATCH v1] man/man3/strtoul.3: BUGS: Signed numbers are not rejected

Bruno Haible
2025-03-21T21:31:48Z

Alejandro Colomar wrote:
> This is one of the patches I will apply after your report. Please
> review.

Looks good to me, except for one line in the sample:

> + if (!isxdigit((unsigned char) *s))

For a general base, this should be

if (!isalnum((unsigned char) *s))

For base <= 16, it can be simplified to

if (!isxdigit((unsigned char) *s))

For base <= 10, it can be simplified to

if (!isdigit((unsigned char) *s))

Bruno