From 5b84b0d660c8329e184d98682665aaea7e1703d2 Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Mon, 23 Nov 2015 22:13:56 +0100 Subject: 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 --- agent/genkey.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'agent') diff --git a/agent/genkey.c b/agent/genkey.c index b780c5049..2eec974d3 100644 --- a/agent/genkey.c +++ b/agent/genkey.c @@ -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) { -- cgit v1.2.3