]> git.armaanb.net Git - stagit.git/commitdiff
simplify range check
authorHiltjo Posthuma <hiltjo@codemadness.org>
Sun, 19 Aug 2018 20:03:45 +0000 (22:03 +0200)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Wed, 22 Aug 2018 16:30:00 +0000 (18:30 +0200)
stagit.c

index a70a2224ca19a409e577a39cffa68c6775b79953..6598ddd2cc0523f918db6c87a01795ced9ee51d9 100644 (file)
--- a/stagit.c
+++ b/stagit.c
@@ -1042,10 +1042,7 @@ main(int argc, char *argv[])
                        errno = 0;
                        nlogcommits = strtoll(argv[++i], &p, 10);
                        if (argv[i][0] == '\0' || *p != '\0' ||
-                           nlogcommits <= 0)
-                               usage(argv[0]);
-                       if (errno == ERANGE && (nlogcommits == LLONG_MAX ||
-                           nlogcommits == LLONG_MIN))
+                           nlogcommits <= 0 || errno)
                                usage(argv[0]);
                }
        }