Avoid unconditional increasing of variable leading to SIGSEGV, if req'd
parameter for -lang is missing.
This commit is contained in:
parent
7e346ee00f
commit
35ea15f054
@ -79,7 +79,7 @@ main(int argc, char *argv[])
|
||||
|
||||
for (i = 1; i < argc; ++i) {
|
||||
if (argv[i][0] == '-') {
|
||||
if (strcmp(argv[i], "-lang") == 0) {
|
||||
if ((strcmp(argv[i], "-lang") == 0) && (argc < i)) {
|
||||
++i;
|
||||
if (strcmp(argv[i], "C") == 0) lang = MCLangC;
|
||||
else if (strcmp(argv[i], "C++") == 0) lang = MCLangCPlusPlus;
|
||||
|
Loading…
Reference in New Issue
Block a user