Skip to content

Commit

Permalink
Some platforms and environments don't pass a valid argc/argv.
Browse files Browse the repository at this point in the history
Specifically some iOS targets.
  • Loading branch information
dominichamon committed May 30, 2018
1 parent d07372e commit 1cfad9f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,8 @@ void PrintUsageAndExit() {

void ParseCommandLineFlags(int* argc, char** argv) {
using namespace benchmark;
BenchmarkReporter::Context::executable_name = argv[0];
BenchmarkReporter::Context::executable_name =
(argc && *argc > 0) ? argv[0] : "unknown";
for (int i = 1; i < *argc; ++i) {
if (ParseBoolFlag(argv[i], "benchmark_list_tests",
&FLAGS_benchmark_list_tests) ||
Expand Down

0 comments on commit 1cfad9f

Please sign in to comment.