summaryrefslogtreecommitdiff
path: root/imp.ha
diff options
context:
space:
mode:
Diffstat (limited to 'imp.ha')
-rw-r--r--imp.ha5
1 files changed, 5 insertions, 0 deletions
diff --git a/imp.ha b/imp.ha
index 2aef8ba..9c57ab8 100644
--- a/imp.ha
+++ b/imp.ha
@@ -128,6 +128,10 @@ export fn main() void = {
const n = getinput("name: ")!;
const u = getinput("user: ")!;
const p = getinput("pass: ", true)!;
+ const cp = getinput("confirm pass: ", true)!;
+ if (p != cp) {
+ fmt::fatal("Passwords don't match");
+ };
if (n == "" || u == "" || p == "") {
free(n);
free(u);
@@ -404,6 +408,7 @@ fn getinput(text: str = "", noecho: bool = false) (str | tty::error | io::error
const termios = tty::termios_query(termf)?;
tty::noecho(&termios)?;
defer tty::termios_restore(&termios);
+ defer fmt::fprintln(termf)!;
return readin(termf)?;
};
return readin(termf)?;