commit: c3e87d50febee1c9f057f60fa80d2406a7bc49b2
parent 19e6ea25352f3905b3b737f333a01b9742495639
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Fri, 23 May 2025 20:12:58 +0200
common: print newline to stdout only if getline was successful
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common.c b/common.c
@@ -97,12 +97,12 @@ skeud_getpass(char **password)
errno = 0;
got = getline(password, &len, tty);
- fprintf(tty, "\n");
if(got < 0)
{
if(errno != 0) perror("skeud_getpass: getline");
goto getpass_clean;
}
+ fprintf(tty, "\n");
(*password)[got] = 0;
(*password)[got - 1] = 0;
got--;