diff options
Diffstat (limited to 'src/shared/ask-password-api.c')
-rw-r--r-- | src/shared/ask-password-api.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/shared/ask-password-api.c b/src/shared/ask-password-api.c index 072bf72c56..bc5e1cf669 100644 --- a/src/shared/ask-password-api.c +++ b/src/shared/ask-password-api.c @@ -385,13 +385,13 @@ int ask_password_tty( if (!(flags & ASK_PASSWORD_SILENT)) backspace_chars(ttyfd, 1); - /* Remove a full UTF-8 codepoint from the end. For that, figure out where the last one - * begins */ + /* Remove a full UTF-8 codepoint from the end. For that, figure out where the + * last one begins */ q = 0; for (;;) { size_t z; - z = utf8_encoded_valid_unichar(passphrase + q); + z = utf8_encoded_valid_unichar(passphrase + q, (size_t) -1); if (z == 0) { q = (size_t) -1; /* Invalid UTF8! */ break; @@ -410,8 +410,8 @@ int ask_password_tty( flags |= ASK_PASSWORD_SILENT; - /* There are two ways to enter silent mode. Either by pressing backspace as first key - * (and only as first key), or ... */ + /* There are two ways to enter silent mode. Either by pressing backspace as + * first key (and only as first key), or ... */ if (ttyfd >= 0) (void) loop_write(ttyfd, "(no echo) ", 10, false); @@ -440,7 +440,7 @@ int ask_password_tty( if (!(flags & ASK_PASSWORD_SILENT) && ttyfd >= 0) { /* Check if we got a complete UTF-8 character now. If so, let's output one '*'. */ - n = utf8_encoded_valid_unichar(passphrase + codepoint); + n = utf8_encoded_valid_unichar(passphrase + codepoint, (size_t) -1); if (n >= 0) { codepoint = p; (void) loop_write(ttyfd, (flags & ASK_PASSWORD_ECHO) ? &c : "*", 1, false); |