Browse Source

prevent pfConsole from crashing when inserting text into a max length line

NadnerbD 13 years ago
parent
commit
02118488bd
  1. 2
      Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp

2
Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp

@ -873,7 +873,7 @@ void pfConsole::IHandleKey( plKeyEventMsg *msg )
} }
} }
// or are they just typing in a working line // or are they just typing in a working line
else if( fWorkingCursor < kMaxCharsWide - 2 && key != 0 ) else if( strlen( fWorkingLine ) < kMaxCharsWide - 2 && key != 0 )
{ {
for( i = strlen( fWorkingLine ) + 1; i > fWorkingCursor; i-- ) for( i = strlen( fWorkingLine ) + 1; i > fWorkingCursor; i-- )
fWorkingLine[ i ] = fWorkingLine[ i - 1 ]; fWorkingLine[ i ] = fWorkingLine[ i - 1 ];

Loading…
Cancel
Save