aboutsummaryrefslogtreecommitdiffstats
path: root/man3
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2006-06-06 01:07:10 +0000
committerMichael Kerrisk <mtk.manpages@gmail.com>2006-06-06 01:07:10 +0000
commit190c7abe49265d77b25470a9e69da4ee54522107 (patch)
treebbcd69c560242061e63042b9c375bf5aff8efc2a /man3
parented7b0235b07df12e4eed8147df6da62edda25b37 (diff)
downloadman-pages-190c7abe49265d77b25470a9e69da4ee54522107.tar.gz
Add text clarifying treatment of strings starting with minus sign.
Diffstat (limited to 'man3')
-rw-r--r--man3/strtoul.38
1 files changed, 6 insertions, 2 deletions
diff --git a/man3/strtoul.3 b/man3/strtoul.3
index f0d6cb5c15..cf2e3e091d 100644
--- a/man3/strtoul.3
+++ b/man3/strtoul.3
@@ -77,7 +77,8 @@ function but returns an unsigned long long integer value.
.SH "RETURN VALUE"
The \fBstrtoul\fP() function returns either the result of the conversion
or, if there was a leading minus sign, the negation of the result of the
-conversion, unless the original (non-negated) value would overflow; in
+conversion represented as an unsigned value,
+unless the original (non-negated) value would overflow; in
the latter case, \fBstrtoul\fP() returns ULONG_MAX and sets the global
variable \fIerrno\fP to ERANGE.
Precisely the same holds for
@@ -108,7 +109,7 @@ and then determine if an error occurred by checking whether
.I errno
has a non-zero value after the call.
-In locales other than the "C" locale, also other strings may be accepted.
+In locales other than the "C" locale, other strings may be accepted.
(For example, the thousands separator of the current locale may be
supported.)
.LP
@@ -127,6 +128,9 @@ may be equivalent to
.BR strtoull ()
or to
.BR strtoul ().
+
+Negative values are considered valid input and are
+silently converted to the equivalent unsigned long value.
.SH "CONFORMING TO"
.BR strtoul ()
conforms to SVID 3, 4.3BSD, ISO 9899 (C99) and POSIX, and