Fixed -z option argument parsing; fixes issue #127
This commit is contained in:
parent
ed69b483ed
commit
03b1d7cf7a
2
Makefile
2
Makefile
|
@ -1,4 +1,4 @@
|
||||||
VERSION = git-20140111
|
VERSION = git-20140115
|
||||||
|
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
MANPREFIX = $(PREFIX)/share/man
|
MANPREFIX = $(PREFIX)/share/man
|
||||||
|
|
|
@ -147,7 +147,7 @@ void parse_options(int argc, char **argv)
|
||||||
break;
|
break;
|
||||||
case 'z':
|
case 'z':
|
||||||
n = strtol(optarg, &end, 0);
|
n = strtol(optarg, &end, 0);
|
||||||
if (*end != '\n' || n <= 0) {
|
if (*end != '\0' || n <= 0) {
|
||||||
fprintf(stderr, "sxiv: invalid argument for option -z: %s\n", optarg);
|
fprintf(stderr, "sxiv: invalid argument for option -z: %s\n", optarg);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue