summaryrefslogtreecommitdiff
path: root/src/legacy
diff options
context:
space:
mode:
Diffstat (limited to 'src/legacy')
-rw-r--r--src/legacy/getpass.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/legacy/getpass.c b/src/legacy/getpass.c
index 15ab9851..d51286c0 100644
--- a/src/legacy/getpass.c
+++ b/src/legacy/getpass.c
@@ -27,7 +27,7 @@ char *getpass(const char *prompt)
l = read(fd, password, sizeof password);
if (l >= 0) {
- if (l > 0 && password[l-1] == '\n') l--;
+ if (l > 0 && password[l-1] == '\n' || l==sizeof password) l--;
password[l] = 0;
}