Commit 9ba850a2 authored by Robert Ricci's avatar Robert Ricci

Fix a few bugs in argument handling for replay.

First, we can't use logWrite() in processArgs(), because it has not
been initialized yet. (And, presumably, the log writer *has* to be
initialized later, because at some point we will want to add command
line args to control its behavior).

Second, actually exit if there are any errors, instead of proceeding
to do the wrong thin.
parent 89f44abb
......@@ -198,14 +198,16 @@ void processArgs(int argc, char * argv[])
}
else
{
logWrite(ERROR, "Error opening replay-save file: %s: %s", optarg,
fprintf(stderr,"Error opening replay-save file: %s: %s\n", optarg,
strerror(errno));
exit(1);
}
}
else
{
logWrite(ERROR, "replay-save option was invoked when replay "
"was already set");
fprintf(stderr, "replay-save option was invoked when replay "
"was already set\n");
exit(1);
}
break;
case 'l':
......@@ -218,14 +220,16 @@ void processArgs(int argc, char * argv[])
}
else
{
logWrite(ERROR, "Error opening replay-load file: %s: %s", optarg,
fprintf(stderr, "Error opening replay-load file: %s: %s\n", optarg,
strerror(errno));
exit(1);
}
}
else
{
logWrite(ERROR, "replay-load option was invoked when replay "
"was already set");
fprintf(stderr, "replay-load option was invoked when replay "
"was already set\n");
exit(1);
}
break;
case '?':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment