Fix bug determining next arg

This commit is contained in:
Alan Baker 2018-07-31 11:45:39 -04:00
parent 89901a8a48
commit 8a0ec22f13

View File

@ -448,7 +448,7 @@ OptStatus ParseOconfigFlag(const char* prog_name, const char* opt_flag,
// the string "|argv[argi]|" is returned.
std::string CanonicalizeFlag(const char** argv, int argc, int* argi) {
const char* cur_arg = argv[*argi];
const char* next_arg = (*(argi + 1) < argc) ? argv[*argi + 1] : nullptr;
const char* next_arg = (*argi + 1 < argc) ? argv[*argi + 1] : nullptr;
std::ostringstream canonical_arg;
canonical_arg << cur_arg;