diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-10-10 20:02:58 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-10-10 20:02:58 +0000 |
| commit | 0d2a4632bbba044915171cf0bf297914e4cba482 (patch) | |
| tree | d6c3f24091b9971db49ec58fd6c829ba4eaed6a2 /src/Fl_Text_Display.cxx | |
| parent | 8b7b26b7bf7fb43fee1342c18fff49c3b753fd95 (diff) | |
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
Diffstat (limited to 'src/Fl_Text_Display.cxx')
| -rw-r--r-- | src/Fl_Text_Display.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
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 $". // |
