]> andersk Git - openssh.git/blobdiff - auth-skey.c
- djm@cvs.openbsd.org 2006/03/25 00:05:41
[openssh.git] / auth-skey.c
index ce8c1a8096d13d05ae0e734d56ba8b89adb4dd3a..3e6a06db7d2fc50cd2c43b2f67ec599e997f1b07 100644 (file)
@@ -53,15 +53,10 @@ skey_query(void *ctx, char **name, char **infotxt,
        *name  = xstrdup("");
        *infotxt  = xstrdup("");
        *numprompts = 1;
-       *prompts = xmalloc(*numprompts * sizeof(char *));
-       *echo_on = xmalloc(*numprompts * sizeof(u_int));
-       (*echo_on)[0] = 0;
+       *prompts = xcalloc(*numprompts, sizeof(char *));
+       *echo_on = xcalloc(*numprompts, sizeof(u_int));
 
-       len = strlen(challenge) + strlen(SKEY_PROMPT) + 1;
-       p = xmalloc(len);
-       strlcpy(p, challenge, len);
-       strlcat(p, SKEY_PROMPT, len);
-       (*prompts)[0] = p;
+       xasprintf(*prompts, "%s%s", challenge, SKEY_PROMPT);
 
        return 0;
 }
This page took 0.031747 seconds and 4 git commands to generate.