From: Hiltjo Posthuma Date: Sun, 19 Aug 2018 20:03:45 +0000 (+0200) Subject: simplify range check X-Git-Url: https://git.atheridis.org/?a=commitdiff_plain;h=175094899d7c453786857d0e5a7d2e634611aea4;p=forks%2Fstagit.git simplify range check --- diff --git a/stagit.c b/stagit.c index a70a222..6598ddd 100644 --- 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]); } }