safe compile .

This commit is contained in:
Zero Fanker 2024-04-25 22:12:25 -04:00
parent 00753d2ff2
commit d1a32df54b
3 changed files with 6 additions and 6 deletions

View file

@ -323,10 +323,10 @@ struct XCString
bUsedDefault = FALSE;
wString = new(WCHAR[len + 1]);
memset(wString, 0, (len + 1) * 2);
memset(wString, 0, (len + 1) * sizeof(WCHAR));
//MultiByteToWideChar(CP_ACP, WC_COMPOSITECHECK, cString, len, wString, len+1);
mbstowcs(wString, cString, len);
size_t convertedSize = 0;
mbstowcs_s(&convertedSize, wString, len + 1, cString, len);
}
void SetString(const WCHAR* wString, int len)
@ -358,7 +358,7 @@ struct XCString
CString cString;
WCHAR* wString;
BOOL bUsedDefault;
int len;
size_t len;
};

View file

@ -42,7 +42,7 @@ static char THIS_FILE[] = __FILE__;
/////////////////////////////////////////////////////////////////////////////
// CViewObjects
const int valadded = 10000;
const size_t valadded = 10000;
IMPLEMENT_DYNCREATE(CViewObjects, CTreeView)

View file

@ -78,7 +78,7 @@ inline CString GetUnitPictureFilename(LPCTSTR lpUnitName, DWORD dwPicIndex)
}
char n[50];
itoa(dwPicIndex, n, 10);
_itoa_s(dwPicIndex, n, 10);
if (pics.find(artname + n) != pics.end()) {