# HG changeset patch # User Kim F. Storm # Date 1105950508 0 # Node ID c0533d2d03af8ea2beab295e710427e622385d6a # Parent 5fc1db8fac5b2be8860bf38b8fbb316e47330f52 (mode_line_string, marginal_area_string): Fix off-by-one error in search for glyph. diff -r 5fc1db8fac5b -r c0533d2d03af src/dispnew.c --- a/src/dispnew.c Mon Jan 17 08:28:01 2005 +0000 +++ b/src/dispnew.c Mon Jan 17 08:28:28 2005 +0000 @@ -5842,7 +5842,7 @@ 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 @@ 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)