fix segfault in certain situations do to missing arguments
This commit is contained in:
2
XD.c
2
XD.c
@ -222,7 +222,7 @@ main(int argc, char *argv[])
|
|||||||
int code = -1;
|
int code = -1;
|
||||||
|
|
||||||
/* print version information */
|
/* print version information */
|
||||||
if (strcmp(argv[1], "-v") == 0) {
|
if (argc > 1 && strcmp(argv[1], "-v") == 0) {
|
||||||
printf("XD [number] v%s\n", VERSION);
|
printf("XD [number] v%s\n", VERSION);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user