From 0d2a4632bbba044915171cf0bf297914e4cba482 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Thu, 10 Oct 2002 20:02:58 +0000 Subject: Fix SF bug #620633 - crash on redisplay in Fl_Text_Display. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2665 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Text_Display.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx index 8e0deafd6..da049dcdc 100644 --- a/src/Fl_Text_Display.cxx +++ b/src/Fl_Text_Display.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Text_Display.cxx,v 1.12.2.30 2002/09/26 20:52:50 easysw Exp $" +// "$Id: Fl_Text_Display.cxx,v 1.12.2.31 2002/10/10 20:02:58 easysw Exp $" // // Copyright 2001-2002 by Bill Spitzak and others. // Original code Copyright Mark Edel. Permission to distribute under @@ -761,7 +761,7 @@ int Fl_Text_Display::position_to_xy( int pos, int* X, int* Y ) { to "pos" to calculate the X coordinate */ xStep = text_area.x - mHorizOffset; outIndex = 0; - for ( charIndex = 0; charIndex < pos - lineStartPos; charIndex++ ) { + for ( charIndex = 0; charIndex < lineLen && charIndex < pos - lineStartPos; charIndex++ ) { charLen = Fl_Text_Buffer::expand_character( lineStr[ charIndex ], outIndex, expandedChar, mBuffer->tab_distance(), mBuffer->null_substitution_character() ); charStyle = position_style( lineStartPos, lineLen, charIndex, @@ -3008,5 +3008,5 @@ int Fl_Text_Display::handle(int event) { // -// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.30 2002/09/26 20:52:50 easysw Exp $". +// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.31 2002/10/10 20:02:58 easysw Exp $". // -- cgit v1.2.3