From 7da5fc91f4243d09cbbe3401386c8845f2a3f5b4 Mon Sep 17 00:00:00 2001 From: Thomas Jensen Date: Tue, 19 Feb 2019 22:02:23 +0100 Subject: [PATCH] Improve error message for invalid box size on osx #54 --- src/boxes.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/boxes.c b/src/boxes.c index d28902c..702a6a1 100644 --- a/src/boxes.c +++ b/src/boxes.c @@ -675,11 +675,7 @@ static int process_commandline (int argc, char *argv[]) opt.reqheight = strtol (pdummy+1, NULL, 10); *pdummy = 'x'; } - if(errno){ - fprintf (stderr, "%s: box size: %s, '%s'\n", - PROJECT, strerror(idummy), optarg); - return 1; - } else if ((opt.reqwidth == 0 && opt.reqheight == 0) + if(errno || (opt.reqwidth == 0 && opt.reqheight == 0) || opt.reqwidth < 0 || opt.reqheight < 0) { fprintf (stderr, "%s: invalid box size specification -- %s\n", PROJECT, optarg);