Cover the case that there is no command-line argument.

pull/16768/head
Guantao Liu 7 years ago
parent 668a16327b
commit e6824674f4
  1. 2
      test/core/iomgr/resolve_address_test.cc

@ -254,7 +254,7 @@ int main(int argc, char** argv) {
// In case that there are more than one argument on the command line,
// --resolver will always be the first one, so only parse the first argument
// (other arguments may be unknown to cl)
gpr_cmdline_parse(cl, 2, argv);
gpr_cmdline_parse(cl, argc > 2 ? 2 : argc, argv);
const char* cur_resolver = gpr_getenv("GRPC_DNS_RESOLVER");
if (cur_resolver != nullptr && strlen(cur_resolver) != 0) {
gpr_log(GPR_INFO, "Warning: overriding resolver setting of %s",

Loading…
Cancel
Save