mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
common: Extend utf8_charcount to include the string's length.
* common/stringhelp.c (utf8_charcount): Take additional parameter, len. Process at most LEN bytes. -- Signed-off-by: Neal H. Walfield <neal@g10code.com>
This commit is contained in:
parent
b75e1b3d8b
commit
5b84b0d660
4 changed files with 22 additions and 8 deletions
|
@ -221,7 +221,7 @@ check_passphrase_constraints (ctrl_t ctrl, const char *pw,
|
|||
|
||||
/* Now check the constraints and collect the error messages unless
|
||||
in in silent mode which returns immediately. */
|
||||
if (utf8_charcount (pw) < minlen )
|
||||
if (utf8_charcount (pw, -1) < minlen )
|
||||
{
|
||||
if (!failed_constraint)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue