From 60a13f806d4b0807ce4ce40e843ac5edd0ae3db3 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 6 May 2003 21:10:21 +0000 Subject: [PATCH] Fix some type mismatches that cause stack corruption in VC7. Never memset(0) a non-POD type (eg. a vector). --- stepmania/src/Model.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stepmania/src/Model.cpp b/stepmania/src/Model.cpp index 38ab8c5566..74e02f7e83 100644 --- a/stepmania/src/Model.cpp +++ b/stepmania/src/Model.cpp @@ -51,7 +51,8 @@ bool Model::LoadMilkshapeAscii( CString sPath ) Clear (); m_pModel = new msModel; - memset (m_pModel, 0, sizeof (msModel)); +// Never zero out a non-POD data type. +// memset (m_pModel, 0, sizeof (msModel)); bool bError = false; char szLine[256]; @@ -217,7 +218,7 @@ bool Model::LoadMilkshapeAscii( CString sPath ) word nIndices[3]; word nNormalIndices[3]; - if (sscanf (szLine, "%d %d %d %d %d %d %d %d", + if (sscanf (szLine, "%d %hd %hd %hd %hd %hd %hd %d", &nFlags, &nIndices[0], &nIndices[1], &nIndices[2], &nNormalIndices[0], &nNormalIndices[1], &nNormalIndices[2],