Avoid unconditional increasing of variable leading to SIGSEGV, if req'd

parameter for -lang is missing.
This commit is contained in:
phantom 2005-02-01 16:01:55 +00:00
parent 7e346ee00f
commit 35ea15f054

View File

@ -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;