X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=imap-send.c;h=e40125a22b72544c107e365d4f09eaa3b1ce53de;hb=df5ed9077f18985a73f00fe2bacc2961598f73dc;hp=9fba422f509ca9e978be0162e34b0285b2727c1a;hpb=5e9637c629702e3d41ad01d95956d1835d7338e0;p=git.git diff --git a/imap-send.c b/imap-send.c index 9fba422f5..e40125a22 100644 --- a/imap-send.c +++ b/imap-send.c @@ -25,6 +25,7 @@ #include "cache.h" #include "exec_cmd.h" #include "run-command.h" +#include "prompt.h" #ifdef NO_OPENSSL typedef void *SSL; #else @@ -161,7 +162,6 @@ static struct imap_server_conf server = { struct imap_store_conf { struct store_conf gen; struct imap_server_conf *server; - unsigned use_namespace:1; }; #define NIL (void *)0x1 @@ -1209,13 +1209,10 @@ static struct store *imap_open_store(struct imap_server_conf *srvc) goto bail; } if (!srvc->pass) { - char prompt[80]; - sprintf(prompt, "Password (%s@%s): ", srvc->user, srvc->host); - arg = git_getpass(prompt); - if (!arg) { - perror("getpass"); - exit(1); - } + struct strbuf prompt = STRBUF_INIT; + strbuf_addf(&prompt, "Password (%s@%s): ", srvc->user, srvc->host); + arg = git_getpass(prompt.buf); + strbuf_release(&prompt); if (!*arg) { fprintf(stderr, "Skipping account %s@%s, no password\n", srvc->user, srvc->host); goto bail;