- fix: avoid calling getpass twice as side effect of xstrdup macro (#17672).

CVS patchset: 4179
CVS date: 2000/09/26 22:28:09
This commit is contained in:
jbj 2000-09-26 22:28:09 +00:00
parent 39b81b5174
commit 4893fba6f0
1 changed files with 3 additions and 1 deletions

View File

@ -221,7 +221,9 @@ static void urlFind(urlinfo *uret, int mustAsk)
prompt = alloca(strlen(u->host) + strlen(u->user) + 256);
sprintf(prompt, _("Password for %s@%s: "), u->user, u->host);
if (u->password) xfree(u->password);
u->password = xstrdup( /*@-unrecog@*/ getpass(prompt) /*@=unrecog@*/ );
/* XXX xstrdup has side effects. */
u->password = /*@-unrecog@*/ getpass(prompt) /*@=unrecog@*/;
u->password = xstrdup(u->password);
}
if (u->proxyh == NULL) {