oops, bugfix (null-terminate the char array, not CString object)

This commit is contained in:
Andrew Wong
2003-07-20 11:52:55 +00:00
parent 8b346a3046
commit 60a3ac3e04
+2 -1
View File
@@ -45,7 +45,8 @@ 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;
// sChoice[sizeof(this->name)-1] = 0;
name[sChoice.GetLength()] = 0;
bool bChoiceIsInvalid = false;