summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2016-11-04 20:16:18 +0000
committerriastradh <riastradh@NetBSD.org>2016-11-04 20:16:18 +0000
commitcbf30d53e6adafc875affb3b7a50d4c0100ddb0f (patch)
treecf7c022feed6879bc54a66023049d325fd1cfda6 /lib/libc/stdlib
parent844b9d981fee26b46dcaaeefda7eecd864b5ffca (diff)
Simplify error condition case.
Add assertions to reflect its implications.
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r--lib/libc/stdlib/strtol.37
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libc/stdlib/strtol.3 b/lib/libc/stdlib/strtol.3
index b7065051f07..405e1cc8e7d 100644
--- a/lib/libc/stdlib/strtol.3
+++ b/lib/libc/stdlib/strtol.3
@@ -1,4 +1,4 @@
-.\" $NetBSD: strtol.3,v 1.36 2016/11/04 20:14:31 riastradh Exp $
+.\" $NetBSD: strtol.3,v 1.37 2016/11/04 20:16:18 riastradh Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -229,8 +229,11 @@ if (ep == buf)
goto not_a_number;
if (*ep != '\e0')
goto trailing_garbage;
-if (errno == ERANGE \*[Am]\*[Am] (lval == LONG_MAX || lval == LONG_MIN))
+if (errno) {
+ assert(errno == ERANGE);
+ assert(lval == LONG_MAX || lval == LONG_MIN);
goto out_of_range;
+}
.Ed
.Pp
This example will accept