Avoid unconditional increasing of variable leading to SIGSEGV, if req'd
parameter for -lang is missing.
This commit is contained in:
parent
6eb48b5f02
commit
3559895440
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=141117
@ -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