From cfde341f3bf4214108cb2aede40ad6f6c1783d23 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 17 Jan 2005 08:28:28 +0000 Subject: [PATCH] (mode_line_string, marginal_area_string): Fix off-by-one error in search for glyph. --- src/dispnew.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dispnew.c b/src/dispnew.c index ff26a4dc66c..1c3c56de80b 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -5842,7 +5842,7 @@ mode_line_string (w, part, x, y, charpos, object, dx, dy, width, height) it's the one we were looking for. */ glyph = row->glyphs[TEXT_AREA]; end = glyph + row->used[TEXT_AREA]; - for (x0 = *x; glyph < end && x0 > glyph->pixel_width; ++glyph) + for (x0 = *x; glyph < end && x0 >= glyph->pixel_width; ++glyph) x0 -= glyph->pixel_width; *x = glyph - row->glyphs[TEXT_AREA]; if (glyph < end) @@ -5934,7 +5934,7 @@ marginal_area_string (w, part, x, y, charpos, object, dx, dy, width, height) glyph = row->glyphs[area]; end = glyph + row->used[area]; - for (x0 = *x - x0; glyph < end && x0 > glyph->pixel_width; ++glyph) + for (x0 = *x - x0; glyph < end && x0 >= glyph->pixel_width; ++glyph) x0 -= glyph->pixel_width; *x = glyph - row->glyphs[area]; if (glyph < end) -- 2.39.5