From c92d02b8d833bcae8f9201ae34bc563f8699d3da Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 29 May 2003 00:12:46 +0000 Subject: [PATCH] fix the measure function's loop too --- glft/font.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/glft/font.c b/glft/font.c index 3c1b33af..33285506 100644 --- a/glft/font.c +++ b/glft/font.c @@ -279,7 +279,7 @@ void GlftMeasureString(struct GlftFont *font, *h = 0; c = str; - while (c) { + while (c - str < bytes) { g = GlftFontGlyph(font, c); if (g) { *w += g->width; @@ -288,7 +288,6 @@ void GlftMeasureString(struct GlftFont *font, *w += font->max_advance_width; } c = g_utf8_next_char(c); - if (c - str > bytes) break; } } -- 2.34.1