X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9817be8a86c3818597a3f7cda014794f57ee8886..d1b8a7430f3a3d78e6ecf4b46e924d6978137da5:/src/msw/font.cpp diff --git a/src/msw/font.cpp b/src/msw/font.cpp index 911cfd84b5..ed8728be50 100644 --- a/src/msw/font.cpp +++ b/src/msw/font.cpp @@ -618,9 +618,7 @@ void wxNativeFontInfo::SetUnderlined(bool underlined) bool wxNativeFontInfo::SetFaceName(const wxString& facename) { - size_t len = WXSIZEOF(lf.lfFaceName); - wxStrncpy(lf.lfFaceName, facename, len); - lf.lfFaceName[len - 1] = '\0'; // truncate the face name + wxStrlcpy(lf.lfFaceName, facename.c_str(), WXSIZEOF(lf.lfFaceName)); return true; }