add safe wxStrlcpy() function and replaced all wxStrncpy() calls by it
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57023 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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, WXSIZEOF(lf.lfFaceName));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user