Fix off by one

This commit is contained in:
Webber 2019-12-01 00:40:13 +01:00 committed by Webber Takken
parent 5dcd509017
commit 2becab230e

View File

@ -13,8 +13,14 @@ static class Builder
providedArguments = new Dictionary<string, string>();
string[] args = Environment.GetCommandLineArgs();
// Output args in console
Debug.Log("Arguments given: ");
foreach (string arg in args) {
Debug.Log(arg);
}
// Extract flags with optional values
for (int current = 0, next = 1; current <= args.Length; current++, next++) {
for (int current = 0, next = 1; current < args.Length; current++, next++) {
// Parse flag
bool isFlag = args[current].StartsWith("-");
if (!isFlag) continue;