Safe wxStrncpy usage.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36225 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
717870a64c
commit
86f6a6d19d
@ -294,7 +294,8 @@ bool wxGetUserName(wxChar *buf, int maxSize)
|
||||
wxString name;
|
||||
if(!key.QueryValue(wxEmptyString, name))
|
||||
return false;
|
||||
wxStrncpy(buf, name.c_str(), maxSize);
|
||||
wxStrncpy(buf, name.c_str(), maxSize-1);
|
||||
buf[maxSize-1] = _T('\0');
|
||||
return true;
|
||||
#elif defined(USE_NET_API)
|
||||
CHAR szUserName[256];
|
||||
|
Loading…
Reference in New Issue
Block a user