fix potential crash
(why is this a char[] instead of a CString, anyway?)
This commit is contained in:
@@ -45,8 +45,7 @@ bool ModeChoice::DescribesCurrentMode() const
|
|||||||
bool ModeChoice::FromString( CString sChoice, bool bIgnoreUnknown )
|
bool ModeChoice::FromString( CString sChoice, bool bIgnoreUnknown )
|
||||||
{
|
{
|
||||||
strncpy( this->name, sChoice, min(sChoice.size()+1, sizeof(this->name)) );
|
strncpy( this->name, sChoice, min(sChoice.size()+1, sizeof(this->name)) );
|
||||||
// sChoice[sizeof(this->name)-1] = 0;
|
name[sizeof(this->name)-1] = 0;
|
||||||
name[sChoice.GetLength()] = 0;
|
|
||||||
|
|
||||||
bool bChoiceIsInvalid = false;
|
bool bChoiceIsInvalid = false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user