Improve error message for invalid box size on osx #54

This commit is contained in:
Thomas Jensen 2019-02-19 22:02:23 +01:00
parent 056a497cc8
commit 7da5fc91f4
No known key found for this signature in database
GPG Key ID: A4ACEE270D0FB7DB

View File

@ -675,11 +675,7 @@ static int process_commandline (int argc, char *argv[])
opt.reqheight = strtol (pdummy+1, NULL, 10); opt.reqheight = strtol (pdummy+1, NULL, 10);
*pdummy = 'x'; *pdummy = 'x';
} }
if(errno){ if(errno || (opt.reqwidth == 0 && opt.reqheight == 0)
fprintf (stderr, "%s: box size: %s, '%s'\n",
PROJECT, strerror(idummy), optarg);
return 1;
} else if ((opt.reqwidth == 0 && opt.reqheight == 0)
|| opt.reqwidth < 0 || opt.reqheight < 0) { || opt.reqwidth < 0 || opt.reqheight < 0) {
fprintf (stderr, "%s: invalid box size specification -- %s\n", fprintf (stderr, "%s: invalid box size specification -- %s\n",
PROJECT, optarg); PROJECT, optarg);