login_prompt: Simplify login_prompt API

The only user of login_prompt is the login tool. This implies that the
first argument is always the same.

It is much easier to verify printf's format string and its argument if
both are next to each other.

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
This commit is contained in:
Samanta Navarro
2023-04-28 11:57:23 +00:00
committed by Serge Hallyn
parent 3010ec11ae
commit 7109b7c066
3 changed files with 14 additions and 16 deletions

View File

@@ -910,7 +910,7 @@ int main (int argc, char **argv)
preauth_flag = false;
username = XMALLOCARRAY (USER_NAME_MAX_LENGTH + 1, char);
username[USER_NAME_MAX_LENGTH] = '\0';
login_prompt (_("\n%s login: "), username, USER_NAME_MAX_LENGTH);
login_prompt (username, USER_NAME_MAX_LENGTH);
if ('\0' == username[0]) {
/* Prompt for a new login */