From 02118488bd3c509eb60616fc85ff0a38cb96ef23 Mon Sep 17 00:00:00 2001 From: NadnerbD Date: Wed, 1 Feb 2012 20:44:49 -0500 Subject: [PATCH] prevent pfConsole from crashing when inserting text into a max length line --- Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp index e10648cc..9d2d57e4 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp @@ -873,7 +873,7 @@ void pfConsole::IHandleKey( plKeyEventMsg *msg ) } } // 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-- ) fWorkingLine[ i ] = fWorkingLine[ i - 1 ];