aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <colomar.6.4.3@gmail.com>2020-10-28 10:33:08 +0100
committerMichael Kerrisk <mtk.manpages@gmail.com>2020-10-28 11:12:22 +0100
commit93f369892aeab4d56b92962224e318f739ee2455 (patch)
tree8839c8a8111e51192d59b031a20ddaf8179be104
parentb924e6b65af27d0ceb28c8fa8b9e7ec7bb50c5c0 (diff)
downloadman-pages-93f369892aeab4d56b92962224e318f739ee2455.tar.gz
strtol.3: EXAMPLES: Simplify errno checking
(No expected change in behavior,) Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
-rw-r--r--man3/strtol.33
1 files changed, 1 insertions, 2 deletions
diff --git a/man3/strtol.3 b/man3/strtol.3
index a436bcac4d..3889ef6b50 100644
--- a/man3/strtol.3
+++ b/man3/strtol.3
@@ -276,8 +276,7 @@ main(int argc, char *argv[])
/* Check for various possible errors */
- if ((errno == ERANGE && (val == LONG_MAX || val == LONG_MIN))
- || (errno != 0 && val == 0)) {
+ if (errno != 0) {
perror("strtol");
exit(EXIT_FAILURE);
}