From e13f8d280bafc6a6b6e31e2eee587660b8333c56 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 13 Nov 2012 15:12:06 -0800 Subject: [PATCH] Fix UTF-8 backward iteration Ouch! --- src/hb-utf-private.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hb-utf-private.hh b/src/hb-utf-private.hh index 8cde82747..ae36ef864 100644 --- a/src/hb-utf-private.hh +++ b/src/hb-utf-private.hh @@ -77,8 +77,8 @@ hb_utf_prev (const uint8_t *text, const uint8_t *start, hb_codepoint_t *unicode) { - const uint8_t *end = text; - while (start < text && (*--text & 0xc0) == 0x80 && end - text < 4) + const uint8_t *end = text--; + while (start < text && (*text & 0xc0) == 0x80 && end - text < 4) text--; hb_codepoint_t c = *text, mask;