logo

skeud

Simple and portable utilities to deal with user accounts (su, login)git clone https://anongit.hacktivis.me/git/skeud.git/
commit: a4faf05600426017fcd69a9aeb389a69e6b57b7a
parent 11a181fe759955661d9e476e434b67625ce766ec
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue, 23 Sep 2025 11:29:37 +0200

common: use write() directly for skeud_getpass prompt

Diffstat:

Mcommon.c5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/common.c b/common.c @@ -86,7 +86,8 @@ skeud_getpass(char **password) goto getpass_end; } - fprintf(tty, "Password: "); + const char *prompt = "Password: "; + write(tty_fd, prompt, strlen(prompt)); t.c_lflag &= ~ECHO; if(tcsetattr(tty_fd, TCSANOW, &t) < 0) { @@ -101,7 +102,7 @@ skeud_getpass(char **password) if(errno != 0) perror("skeud_getpass: error: getline"); goto getpass_clean; } - fprintf(tty, "\n"); + fputs("\n", tty); (*password)[got] = 0; (*password)[got - 1] = 0; got--;