From: Dana Jansens Date: Thu, 29 May 2003 00:12:46 +0000 (+0000) Subject: fix the measure function's loop too X-Git-Tag: gl2~49 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=c92d02b8d833bcae8f9201ae34bc563f8699d3da;p=dana%2Fopenbox.git fix the measure function's loop too --- 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; } }