mirror of https://github.com/google/benchmark.git
ParseCommandLineFlags(): do not dereference argc if it is null
Higher up we dereference argc only if it is not null. But here we do no such check.
This commit is contained in:
parent
c22c266eaf
commit
51d991f1d7
|
@ -435,7 +435,7 @@ void ParseCommandLineFlags(int* argc, char** argv) {
|
|||
using namespace benchmark;
|
||||
BenchmarkReporter::Context::executable_name =
|
||||
(argc && *argc > 0) ? argv[0] : "unknown";
|
||||
for (int i = 1; i < *argc; ++i) {
|
||||
for (int i = 1; argc && i < *argc; ++i) {
|
||||
if (ParseBoolFlag(argv[i], "benchmark_list_tests",
|
||||
&FLAGS_benchmark_list_tests) ||
|
||||
ParseStringFlag(argv[i], "benchmark_filter", &FLAGS_benchmark_filter) ||
|
||||
|
|
Loading…
Reference in New Issue