Link: <https://stackoverflow.com/questions/
60955490/strtoul-what-is-the-correct-return-value-for-very-negative-strings>
Reported-by: Bruno Haible <bruno@clisp.org>
Co-authored-by: Bruno Haible <bruno@clisp.org>
Signed-off-by: Bruno Haible <bruno@clisp.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
goto unsupported_base;
.EE
.in
+.SH BUGS
+.SS White space
+These functions silently accept leading white space.
+To reject white space, call
+.BR isspace (3)
+before
+.BR strtol ().
.SH EXAMPLES
The program shown below demonstrates the use of
.BR strtol ().
and then determine if an error occurred by checking whether
.I errno
has a nonzero value after the call.
-.P
-Negative values are considered valid input and are
-silently converted to the equivalent
-.I "unsigned long"
-value.
+.SH BUGS
+.SS Signed numbers
+Some negative values
+are considered valid input and
+are silently converted to
+.IR "\%unsigned\ long" .
+.SS White space
+These functions silently accept leading whitespace.
+.SS isalnum(3)
+To reject white space and/or a sign, call
+.BR isalnum (3)
+before
+.BR strtoul ().
.SH EXAMPLES
See the example on the
.BR strtol (3)