3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-04 19:19:23 +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;
}
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);
L_AUTO_FREE_VAR(char *, args);
char *prompt;
@ -205,10 +206,10 @@ void display_refresh_set_cmd(const char *family, const char *entity,
args = l_string_unwrap(buf);
prompt = l_strdup_printf(IWD_PROMPT"%s%s%s %s %s\n",
family ? : "",
entity ? " " : "", entity ? : "",
cmd->cmd ? : "", args ? : "");
prompt = l_strdup_printf(IWD_PROMPT"%s%s%s %s %s\n", family,
entity ? " " : "",
entity ? : "",
cmd->cmd ? : "", args ? : "");
l_queue_push_tail(display_refresh.redo_entries, prompt);
display_refresh.undo_lines++;