diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-06-10 21:04:20 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-06-10 21:04:20 +0000 |
| commit | ddd6ab5d83de416ed1e06495050a43657c7e3605 (patch) | |
| tree | 928fe425d0a15a87f7e618692dc5a5b23fc7f3ab /src/Fl_Text_Buffer.cxx | |
| parent | 10c613f88a72dcc5c38d497a75405b12bd0bfbd5 (diff) | |
Fix some editor problems; still have a few bugs that need to be resolved
before 1.1.0...
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2304 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Text_Buffer.cxx')
| -rw-r--r-- | src/Fl_Text_Buffer.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Fl_Text_Buffer.cxx b/src/Fl_Text_Buffer.cxx index 8043f05e0..5b65f82b3 100644 --- a/src/Fl_Text_Buffer.cxx +++ b/src/Fl_Text_Buffer.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Text_Buffer.cxx,v 1.9.2.7 2002/06/09 13:35:49 easysw Exp $" +// "$Id: Fl_Text_Buffer.cxx,v 1.9.2.8 2002/06/10 21:04:19 easysw Exp $" // // Copyright 2001-2002 by Bill Spitzak and others. // Original code Copyright Mark Edel. Permission to distribute under @@ -202,7 +202,7 @@ char * Fl_Text_Buffer::text_range( int start, int end ) { ** Return the character at buffer position "pos". Positions start at 0. */ char Fl_Text_Buffer::character( int pos ) { - if ( pos < 0 || pos > mLength ) + if ( pos < 0 || pos >= mLength ) return '\0'; if ( pos < mGapStart ) return mBuf[ pos ]; @@ -631,15 +631,15 @@ void Fl_Text_Buffer::add_modify_callback( Fl_Text_Modify_Cb bufModifiedCB, newModifyProcs = new Fl_Text_Modify_Cb [ mNModifyProcs + 1 ]; newCBArgs = new void * [ mNModifyProcs + 1 ]; for ( i = 0; i < mNModifyProcs; i++ ) { - newModifyProcs[ i ] = mNodifyProcs[ i ]; - newCBArgs[ i ] = mCbArgs[ i ]; + newModifyProcs[ i + 1 ] = mNodifyProcs[ i ]; + newCBArgs[ i + 1 ] = mCbArgs[ i ]; } if ( mNModifyProcs != 0 ) { delete [] mNodifyProcs; delete [] mCbArgs; } - newModifyProcs[ mNModifyProcs ] = bufModifiedCB; - newCBArgs[ mNModifyProcs ] = cbArg; + newModifyProcs[ 0 ] = bufModifiedCB; + newCBArgs[ 0 ] = cbArg; mNModifyProcs++; mNodifyProcs = newModifyProcs; mCbArgs = newCBArgs; @@ -2284,5 +2284,5 @@ Fl_Text_Buffer::outputfile(const char *file, int start, int end, int buflen) { // -// End of "$Id: Fl_Text_Buffer.cxx,v 1.9.2.7 2002/06/09 13:35:49 easysw Exp $". +// End of "$Id: Fl_Text_Buffer.cxx,v 1.9.2.8 2002/06/10 21:04:19 easysw Exp $". // |
