commit e3551ab56ba76d198c19e2101c12b9408837950d
parent e859e988694675d9a33bc3504d9104db99a7cc12
Author: Tim Kourt <tim.a.kourt@linux.intel.com>
Date: Tue, 22 Oct 2019 16:13:16 -0700
t-runner: Check for NULL before using strcmp
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/test-runner.c b/tools/test-runner.c
@@ -2957,9 +2957,9 @@ int main(int argc, char *argv[])
break;
case 'g':
gdb_opt = optarg;
- if (!(!strcmp(gdb_opt, "iwd") ||
- !strcmp(gdb_opt, "hostapd") ||
- !strcmp(gdb_opt, "hwsim"))) {
+ if (!gdb_opt || (strcmp(gdb_opt, "iwd") &&
+ strcmp(gdb_opt, "hostapd") &&
+ strcmp(gdb_opt, "hwsim"))) {
l_error("--gdb can only be used with iwd"
", hwsim or hostapd");
return EXIT_FAILURE;