aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-08-06 09:41:56 (GMT)
committerJouni Malinen <j@w1.fi>2016-08-06 09:41:56 (GMT)
commit980afcce53fefd762f2a1c16eaa01e9ff3c004e0 (patch)
tree01cd054041c47a11ed24f9a7b0fd2b43a123e494 /wpa_supplicant
parentfcc84b48b2827abbb84394a0acee6ac0ea74071f (diff)
downloadhostap-980afcce53fefd762f2a1c16eaa01e9ff3c004e0.zip
hostap-980afcce53fefd762f2a1c16eaa01e9ff3c004e0.tar.gz
hostap-980afcce53fefd762f2a1c16eaa01e9ff3c004e0.tar.bz2
cli: Share a common write_cmd() implementation
wpa_cli and hostapd_cli had identical copies of this function. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant')
-rw-r--r--wpa_supplicant/wpa_cli.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index 42be5b6..28fe76c 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -256,36 +256,6 @@ static int wpa_ctrl_command(struct wpa_ctrl *ctrl, char *cmd)
}
-static int write_cmd(char *buf, size_t buflen, const char *cmd, int argc,
- char *argv[])
-{
- int i, res;
- char *pos, *end;
-
- pos = buf;
- end = buf + buflen;
-
- res = os_snprintf(pos, end - pos, "%s", cmd);
- if (os_snprintf_error(end - pos, res))
- goto fail;
- pos += res;
-
- for (i = 0; i < argc; i++) {
- res = os_snprintf(pos, end - pos, " %s", argv[i]);
- if (os_snprintf_error(end - pos, res))
- goto fail;
- pos += res;
- }
-
- buf[buflen - 1] = '\0';
- return 0;
-
-fail:
- printf("Too long command\n");
- return -1;
-}
-
-
static int wpa_cli_cmd(struct wpa_ctrl *ctrl, const char *cmd, int min_args,
int argc, char *argv[])
{