From 10a7830ba2b5e26f8a37c160f7425a3130d67ae0 Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 18 Aug 2015 13:58:57 +0200 Subject: [PATCH] fixes Windows version of readPasswordFromStdin (setLen doesn't accept negative values anymore) --- lib/impure/rdstdin.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/impure/rdstdin.nim b/lib/impure/rdstdin.nim index 14aefb315..b373859f4 100644 --- a/lib/impure/rdstdin.nim +++ b/lib/impure/rdstdin.nim @@ -94,7 +94,7 @@ when defined(Windows): while i < password.len: x = runeLenAt(password, i) inc i, x - password.setLen(password.len - x) + password.setLen(max(password.len - x, 0)) else: password.add(toUTF8(c.Rune)) stdout.write "\n"