Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

[nrf noup] zephyr: Fix failure processing of no-response commands #170

Merged
merged 1 commit into from
May 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions wpa_supplicant/wpa_cli_zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,19 @@ static int _wpa_ctrl_command(struct wpa_ctrl *ctrl, const char *cmd, int print,
/* Remove the LF */
os_memcpy(resp, buf, len - 1);
resp[len - 1] = '\0';
if (strncmp(resp, "FAIL", 4) == 0)
return -3;
}

if (print) {
buf[len] = '\0';
if (buf[0] != '\0')
printf("%s", buf);
}

if (len > 1 && (strncmp(resp, "FAIL", 4) == 0)) {
wpa_printf(MSG_ERROR, "Command failed: %s", resp);
return -3;
}

return 0;
}

Expand Down
Loading