1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +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:
Neal H. Walfield 2015-11-23 22:13:56 +01:00
parent b75e1b3d8b
commit 5b84b0d660
4 changed files with 22 additions and 8 deletions

View file

@ -1043,7 +1043,7 @@ build_list (const char *text, char letter,
if (maybe_setuid)
gcry_control (GCRYCTL_INIT_SECMEM, 0, 0); /* Drop setuid. */
indent = utf8_charcount (text);
indent = utf8_charcount (text, -1);
len = 0;
init_membuf (&mb, 512);