diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-12-07 16:43:15 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-12-07 16:43:15 +0100 |
commit | 86ee7f112f34e827abb9edcf41bc9e5f188bf646 (patch) | |
tree | 81a318aa7c0e7e4d2a5c54f807e9a7d35fd100c8 /common | |
parent | 36a886a9f701d0dc7a6168dcc972e331dd9b6792 (diff) | |
parent | c385e034e50e83e18543f03919dca3e299180f28 (diff) | |
download | barebox-86ee7f112f34e827abb9edcf41bc9e5f188bf646.tar.gz barebox-86ee7f112f34e827abb9edcf41bc9e5f188bf646.tar.xz |
Merge branch 'for-next/misc'
Diffstat (limited to 'common')
-rw-r--r-- | common/password.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/common/password.c b/common/password.c index a03e1dbff7..d157a11b7b 100644 --- a/common/password.c +++ b/common/password.c @@ -66,11 +66,14 @@ int password(unsigned char *passwd, size_t length, int flags, int timeout) case CTL_CH('h'): case KEY_DEL7: case KEY_DEL: - if (flags & STAR && pos > 0) - puts("\b \b"); - *buf = '\0'; - buf--; - pos--; + if (pos > 0) { + if (flags & STAR) + puts("\b \b"); + + *buf = '\0'; + buf--; + pos--; + } continue; default: if (pos < length - 1) { |