diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-08-26 09:18:39 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-08-26 09:18:39 +0200 |
commit | 42237f52084d203dccddcb58b452d676fd8d70fe (patch) | |
tree | 732eaaafa9518ae06c343271702006419a5e9a27 | |
parent | 8307642c8c0dab1dcfccb5f36b4e5e5e3f4f12be (diff) |
Simplify errno checks
-rw-r--r-- | src/main.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -64,7 +64,6 @@ main(int argc, char **argv) if (!xisdigit(optarg[0])) errx(1, "%s: Invalid integer", optarg); - errno = 0; char *endptr; long n = strtol(optarg, &endptr, 10); @@ -77,8 +76,8 @@ main(int argc, char **argv) LONG_MIN. */ if (n > INT_MAX) errno = ERANGE; - if (errno == ERANGE) err(1, "%s", optarg); + } if (n == 0) errx(1, "%s: Integer must be non-zero", optarg); |