Re: [PATCH v3 1/2] man/man3/strto[u]l.3: BUGS: Signed numbers and white space are not rejected

Bruno Haible
2025-03-23T10:28:10Z

Thanks for theses BUGS sections, Alejandro.

> +.SS White space
> +These functions silently accept leading white space.
> +One should call
> +.BR isspace (3)
> +before
> +.BR strtol ()
> +to reject white space.

Just a question of wording, but it would be more straightforward to read
when written like this:

+.SS White space
+These functions silently accept leading white space.
+In situations where rejecting white space is desired instead, call
+.BR isspace (3)
+before
+.BR strtol ().

(As usual, presenting the "why" and "what" before the "how" is nicer. [1])

> +One should call
> +.BR isalnum (3)
> +before
> +.BR strtoul ()
> +to reject white space and/or a sign.

Likewise here. It is more straightforward when written like this:

+To reject white space and/or a sign, call
+.BR isalnum (3)
+before
+.BR strtoul ().

Bruno

[1] https://gitlab.com/ghwiki/gnow-how/-/wikis/Documentation/Writing