diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2003-01-12 14:49:33 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2003-01-12 14:49:33 +0000 |
| commit | 24455b9be53b712e6b1145612ebcbfb302ec1174 (patch) | |
| tree | c7ec1a8f198e9c65612908beacd36d2f45a39344 /src/Fl_Text_Display.cxx | |
| parent | d43b146df3dc86053e111da818620f35873824bf (diff) | |
Fix use of free() for memory allocated using new.
Fix error messages to use Fl::error() instead of fprintf().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2898 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Text_Display.cxx')
| -rw-r--r-- | src/Fl_Text_Display.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx index e95cc391b..dafebfa05 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.40 2002/12/26 01:15:32 matthiaswm Exp $" +// "$Id: Fl_Text_Display.cxx,v 1.12.2.41 2003/01/12 14:49:33 easysw Exp $" // // Copyright 2001-2002 by Bill Spitzak and others. // Original code Copyright Mark Edel. Permission to distribute under @@ -1359,7 +1359,7 @@ int Fl_Text_Display::position_to_line( int pos, int *lineNum ) { if ( empty_vlines() ) { if ( mLastChar < mBuffer->length() ) { if ( !position_to_line( mLastChar, lineNum ) ) { - fprintf( stderr, "Consistency check ptvl failed\n" ); + Fl::error("Fl_Text_Display::position_to_line(): Consistency check ptvl failed"); return 0; } return ++( *lineNum ) <= mNVisibleLines - 1; @@ -1428,8 +1428,8 @@ void Fl_Text_Display::draw_vline(int visLineNum, int leftClip, int rightClip, prevent a potential infinite loop if X does not advance */ stdCharWidth = TMPFONTWIDTH; //mFontStruct->max_bounds.width; if ( stdCharWidth <= 0 ) { - fprintf( stderr, "Internal Error, bad font measurement\n" ); - delete [] (char *)lineStr; + Fl::error("Fl_Text_Display::draw_vline(): bad font measurement"); + free((void *)lineStr); return; } @@ -1537,7 +1537,7 @@ void Fl_Text_Display::draw_vline(int visLineNum, int leftClip, int rightClip, } */ if ( lineStr != NULL ) - delete [] (char *)lineStr; + free((void *)lineStr); } /* @@ -3038,5 +3038,5 @@ int Fl_Text_Display::handle(int event) { // -// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.40 2002/12/26 01:15:32 matthiaswm Exp $". +// End of "$Id: Fl_Text_Display.cxx,v 1.12.2.41 2003/01/12 14:49:33 easysw Exp $". // |
