[CHARMAP]

Use rather wcsncpy(). A bit less safe, but at least, data are copied till possible

svn path=/trunk/; revision=62675
This commit is contained in:
Pierre Schweitzer 2014-04-06 20:20:39 +00:00
parent b2ec16885c
commit dc8ea64b3f
2 changed files with 6 additions and 6 deletions

View file

@ -48,9 +48,9 @@ SetLrgFont(PMAP infoPtr)
hdc);
lf.lfCharSet = DEFAULT_CHARSET;
wcscpy_s(lf.lfFaceName,
sizeof(lf.lfFaceName) / sizeof(lf.lfFaceName[0]),
lpFontName);
wcsncpy(lf.lfFaceName,
lpFontName,
sizeof(lf.lfFaceName) / sizeof(lf.lfFaceName[0]));
hFont = CreateFontIndirectW(&lf);

View file

@ -228,9 +228,9 @@ SetFont(PMAP infoPtr,
ReleaseDC(infoPtr->hMapWnd, hdc);
infoPtr->CurrentFont.lfCharSet = DEFAULT_CHARSET;
wcscpy_s(infoPtr->CurrentFont.lfFaceName,
sizeof(infoPtr->CurrentFont.lfFaceName) / sizeof(infoPtr->CurrentFont.lfFaceName[0]),
lpFontName);
wcsncpy(infoPtr->CurrentFont.lfFaceName,
lpFontName,
sizeof(infoPtr->CurrentFont.lfFaceName) / sizeof(infoPtr->CurrentFont.lfFaceName[0]));
infoPtr->hFont = CreateFontIndirectW(&infoPtr->CurrentFont);