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 authored and Serge Hallyn committed 2023-05-03 07:54:28 -05:00
1 parent 3010ec11ae
commit 7109b7c066
3 files changed
+14 -16

No files matched your search

+1 -1
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 */