Sync with trunk.
[reactos.git] / base / applications / charmap / map.c
index 0029656..9c7b3ee 100644 (file)
@@ -228,8 +228,9 @@ SetFont(PMAP infoPtr,
     ReleaseDC(infoPtr->hMapWnd, hdc);
 
     infoPtr->CurrentFont.lfCharSet =  DEFAULT_CHARSET;
-    wcscpy(infoPtr->CurrentFont.lfFaceName,
-           lpFontName);
+    wcsncpy(infoPtr->CurrentFont.lfFaceName,
+            lpFontName,
+            sizeof(infoPtr->CurrentFont.lfFaceName) / sizeof(infoPtr->CurrentFont.lfFaceName[0]));
 
     infoPtr->hFont = CreateFontIndirectW(&infoPtr->CurrentFont);