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:
Roman Lebedev 2019-11-23 00:23:11 +03:00
parent c22c266eaf
commit 51d991f1d7
No known key found for this signature in database
GPG key ID: 083C3EBB4A1689E0

View file

@ -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) ||