From b656bda455540f8925edd088e8b5476dede28d58 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 20 Jul 2003 18:19:38 +0000 Subject: [PATCH] fix potential crash (why is this a char[] instead of a CString, anyway?) --- stepmania/src/ModeChoice.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stepmania/src/ModeChoice.cpp b/stepmania/src/ModeChoice.cpp index cf0aa4a1ee..bcf2242393 100644 --- a/stepmania/src/ModeChoice.cpp +++ b/stepmania/src/ModeChoice.cpp @@ -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;