From 860e13bd992c1965c38eb82d02cafdd35ff8a941 Mon Sep 17 00:00:00 2001 From: Thomas Kupper Date: Thu, 16 Jul 2020 17:53:12 +0200 Subject: [PATCH] Fix args `-w` and `-H` check - Fix logic error in arguments check to ensure that `-w` and `-H` aren't used at the same time --- src/catimg.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/catimg.c b/src/catimg.c index a00ccdb..c5bb00a 100644 --- a/src/catimg.c +++ b/src/catimg.c @@ -88,9 +88,7 @@ int main(int argc, char *argv[]) printf(USAGE); exit(1); } - if (rows == 0) { - adjust_to_height = 1; - } + adjust_to_height = 1; break; case 'w': cols = strtol(optarg, &num, 0) >> 1; @@ -100,10 +98,8 @@ int main(int argc, char *argv[]) printf(USAGE); exit(1); } - if (cols == 0) { - adjust_to_width = 1; - } - break; + adjust_to_width = 1; + break; case 'l': loops = strtol(optarg, &num, 0); break;