Skip to content

Commit

Permalink
sample_substr_validator: bug fix for --reject_if_present
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpanderson committed Feb 1, 2015
1 parent 5c5f996 commit 57e8f8c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions sched/sample_substr_validator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,22 @@ char* stderr_string;
bool reject_if_present = false;

void parse_cmdline() {
bool found = false;
for (int i=1; i<g_argc; i++) {
if (!strcmp(g_argv[i], "--stderr_string")) {
stderr_string = g_argv[++i];
return;
found = true;
}
if (!strcmp(g_argv[i], "--reject_if_present")) {
reject_if_present = true;
}
}
log_messages.printf(MSG_CRITICAL,
"--stderr_string missing from command line\n"
);
exit(1);
if (!found) {
log_messages.printf(MSG_CRITICAL,
"--stderr_string missing from command line\n"
);
exit(1);
}
}

int init_result(RESULT& r, void*&) {
Expand Down

0 comments on commit 57e8f8c

Please sign in to comment.