changeset 59592:c0533d2d03af

(mode_line_string, marginal_area_string): Fix off-by-one error in search for glyph.
author Kim F. Storm <storm@cua.dk>
date Mon, 17 Jan 2005 08:28:28 +0000
parents 5fc1db8fac5b
children 09e783254290
files src/dispnew.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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)