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:
Włodzimierz Skiba 2005-11-22 11:57:55 +00:00
parent 717870a64c
commit 86f6a6d19d

View File

@ -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];