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:
Vadim Zeitlin
2008-11-29 14:41:02 +00:00
parent 56ce942b62
commit e408bf5257
27 changed files with 126 additions and 89 deletions

View File

@@ -807,7 +807,7 @@ bool wxDialUpManagerMSW::Dial(const wxString& nameOfISP,
RASDIALPARAMS rasDialParams;
rasDialParams.dwSize = sizeof(rasDialParams);
wxStrncpy(rasDialParams.szEntryName, entryName, RAS_MaxEntryName);
wxStrlcpy(rasDialParams.szEntryName, entryName, RAS_MaxEntryName);
// do we have the username and password?
if ( !username || !password )
@@ -829,8 +829,8 @@ bool wxDialUpManagerMSW::Dial(const wxString& nameOfISP,
}
else
{
wxStrncpy(rasDialParams.szUserName, username, UNLEN);
wxStrncpy(rasDialParams.szPassword, password, PWLEN);
wxStrlcpy(rasDialParams.szUserName, username, UNLEN);
wxStrlcpy(rasDialParams.szPassword, password, PWLEN);
}
// default values for other fields