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:
@@ -123,10 +123,9 @@ wxChar *wxLoadUserResource(const wxString& resourceName, const wxString& resourc
|
||||
|
||||
// Not all compilers put a zero at the end of the resource (e.g. BC++ doesn't).
|
||||
// so we need to find the length of the resource.
|
||||
int len = ::SizeofResource(wxGetInstance(), hResource);
|
||||
wxChar *s = new wxChar[len+1];
|
||||
wxStrncpy(s,theText,len);
|
||||
s[len]=0;
|
||||
int len = ::SizeofResource(wxGetInstance(), hResource) + 1;
|
||||
wxChar *s = new wxChar[len];
|
||||
wxStrlcpy(s, theText, len);
|
||||
|
||||
// Obsolete in WIN32
|
||||
#ifndef __WIN32__
|
||||
|
Reference in New Issue
Block a user