fix segfault in certain situations do to missing arguments

This commit is contained in:
2024-12-22 12:57:26 -05:00
parent 6e5d8a1e6a
commit 202142a8af

2
XD.c
View File

@ -222,7 +222,7 @@ main(int argc, char *argv[])
int code = -1;
/* print version information */
if (strcmp(argv[1], "-v") == 0) {
if (argc > 1 && strcmp(argv[1], "-v") == 0) {
printf("XD [number] v%s\n", VERSION);
return 0;
}