mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-17 18:34:03 -05:00
wpa_cli: Make second argument to set command optional
This can be used to indicate zero length value.
This commit is contained in:
parent
69fbdfe48d
commit
40eac89023
@ -381,13 +381,17 @@ static int wpa_cli_cmd_set(struct wpa_ctrl *ctrl, int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (argc != 2) {
|
||||
if (argc != 1 && argc != 2) {
|
||||
printf("Invalid SET command: needs two arguments (variable "
|
||||
"name and value)\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
res = os_snprintf(cmd, sizeof(cmd), "SET %s %s", argv[0], argv[1]);
|
||||
if (argc == 1)
|
||||
res = os_snprintf(cmd, sizeof(cmd), "SET %s ", argv[0]);
|
||||
else
|
||||
res = os_snprintf(cmd, sizeof(cmd), "SET %s %s",
|
||||
argv[0], argv[1]);
|
||||
if (res < 0 || (size_t) res >= sizeof(cmd) - 1) {
|
||||
printf("Too long SET command.\n");
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user