diff options
Diffstat (limited to 'src/legacy/getpass.c')
-rw-r--r-- | src/legacy/getpass.c | 2 |
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; } |