3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 14:49:24 +01:00

client: Check family name before comparison

This commit is contained in:
Tim Kourt 2019-10-23 13:24:02 -07:00 committed by Denis Kenzior
parent 25b3cb77e1
commit ea0fc68597

View File

@ -180,7 +180,8 @@ void display_refresh_set_cmd(const char *family, const char *entity,
return; return;
} }
if (display_refresh.family && !strcmp(display_refresh.family, family)) { if (display_refresh.family && family &&
!strcmp(display_refresh.family, family)) {
struct l_string *buf = l_string_new(128); struct l_string *buf = l_string_new(128);
L_AUTO_FREE_VAR(char *, args); L_AUTO_FREE_VAR(char *, args);
char *prompt; char *prompt;
@ -205,9 +206,9 @@ void display_refresh_set_cmd(const char *family, const char *entity,
args = l_string_unwrap(buf); args = l_string_unwrap(buf);
prompt = l_strdup_printf(IWD_PROMPT"%s%s%s %s %s\n", prompt = l_strdup_printf(IWD_PROMPT"%s%s%s %s %s\n", family,
family ? : "", entity ? " " : "",
entity ? " " : "", entity ? : "", entity ? : "",
cmd->cmd ? : "", args ? : ""); cmd->cmd ? : "", args ? : "");
l_queue_push_tail(display_refresh.redo_entries, prompt); l_queue_push_tail(display_refresh.redo_entries, prompt);