fix potential crash

(why is this a char[] instead of a CString, anyway?)
This commit is contained in:
Glenn Maynard
2003-07-20 18:19:38 +00:00
parent eaa288a44f
commit b656bda455
+1 -2
View File
@@ -45,8 +45,7 @@ bool ModeChoice::DescribesCurrentMode() const
bool ModeChoice::FromString( CString sChoice, bool bIgnoreUnknown )
{
strncpy( this->name, sChoice, min(sChoice.size()+1, sizeof(this->name)) );
// sChoice[sizeof(this->name)-1] = 0;
name[sChoice.GetLength()] = 0;
name[sizeof(this->name)-1] = 0;
bool bChoiceIsInvalid = false;