diff --git a/src/benchmark.cc b/src/benchmark.cc index 95f6a25b..0a5baf86 100644 --- a/src/benchmark.cc +++ b/src/benchmark.cc @@ -634,7 +634,7 @@ void ParseCommandLineFlags(int* argc, char** argv) { // TODO: Remove this. ParseStringFlag(argv[i], "color_print", &FLAGS_benchmark_color) || ParseInt32Flag(argv[i], "v", &FLAGS_v)) { - for (int j = i; j != *argc; ++j) argv[j] = argv[j + 1]; + for (int j = i; j != *argc - 1; ++j) argv[j] = argv[j + 1]; --(*argc); --i;