From 36a4f4a482456ee816dcb59befa0b0538ba487df Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 18 Jan 2012 22:16:49 -0500 Subject: [PATCH] Replace u_strlen() with u_countChar32() The latter is what I meant. --- src/hb-icu.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/hb-icu.cc b/src/hb-icu.cc index cc551d33d..5cf09b28c 100644 --- a/src/hb-icu.cc +++ b/src/hb-icu.cc @@ -36,7 +36,7 @@ #include #include #include -#include +#include @@ -190,8 +190,7 @@ hb_icu_unicode_compose (hb_unicode_funcs_t *ufuncs HB_UNUSED, len = unorm_normalize (utf16, len, UNORM_NFC, 0, normalized, ARRAY_LENGTH (normalized), &icu_err); if (icu_err) return FALSE; - normalized[len] = 0; - if (u_strlen (normalized) == 1) { + if (u_countChar32 (normalized, len) == 1) { U16_GET_UNSAFE (normalized, 0, *ab); ret = TRUE; } else { @@ -227,8 +226,7 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED, if (icu_err) return FALSE; - normalized[len] = 0; - len = u_strlen (normalized); + len = u_countChar32 (normalized, len); if (len == 1) { U16_GET_UNSAFE (normalized, 0, *a);