aboutsummaryrefslogtreecommitdiffstats
path: root/options.c
diff options
context:
space:
mode:
Diffstat (limited to 'options.c')
-rw-r--r--options.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/options.c b/options.c
index 1405dc4..2226040 100644
--- a/options.c
+++ b/options.c
@@ -95,7 +95,7 @@ void parse_options(int argc, char **argv) {
print_usage();
exit(EXIT_SUCCESS);
case 'n':
- if (!sscanf(optarg, "%d", &t) || t < 1) {
+ if (sscanf(optarg, "%d", &t) <= 0 || t < 1) {
fprintf(stderr, "sxiv: invalid argument for option -n: %s\n",
optarg);
exit(EXIT_FAILURE);
@@ -127,7 +127,7 @@ void parse_options(int argc, char **argv) {
break;
case 'z':
_options.scalemode = SCALE_ZOOM;
- if (!sscanf(optarg, "%d", &t) || t <= 0) {
+ if (sscanf(optarg, "%d", &t) <= 0 || t <= 0) {
fprintf(stderr, "sxiv: invalid argument for option -z: %s\n",
optarg);
exit(EXIT_FAILURE);