commit: c0aebddd2918c6f212e34add1d1744d87c30ee0c
parent 829c2664db671ff4335fb423f26711368e14e509
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Tue, 1 Nov 2022 18:14:19 +0100
common: Clean tty on getline failure
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/common.c b/common.c
@@ -104,12 +104,13 @@ skeud_getpass(char **password)
tcsetattr(tty_fd, TCSANOW, &t);
if(errno != 0) perror("skeud_getpass: getline");
- goto getpass_end;
+ goto getpass_clean;
}
(*password)[got] = 0;
(*password)[got - 1] = 0;
got--;
+getpass_clean:
t.c_lflag &= ECHO;
if(tcsetattr(tty_fd, TCSANOW, &t) < 0)
{