[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); hdc);
lf.lfCharSet = DEFAULT_CHARSET; lf.lfCharSet = DEFAULT_CHARSET;
wcscpy_s(lf.lfFaceName, wcsncpy(lf.lfFaceName,
sizeof(lf.lfFaceName) / sizeof(lf.lfFaceName[0]), lpFontName,
lpFontName); sizeof(lf.lfFaceName) / sizeof(lf.lfFaceName[0]));
hFont = CreateFontIndirectW(&lf); hFont = CreateFontIndirectW(&lf);

View file

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