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

@@ -197,7 +197,7 @@ bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip)
notifyData.uFlags |= NIF_TIP;
if ( !tooltip.empty() )
{
wxStrncpy(notifyData.szTip, tooltip.wx_str(), WXSIZEOF(notifyData.szTip));
wxStrlcpy(notifyData.szTip, tooltip.wx_str(), WXSIZEOF(notifyData.szTip));
}
bool ok = wxShellNotifyIcon(m_iconAdded ? NIM_MODIFY
@@ -235,8 +235,8 @@ wxTaskBarIcon::ShowBalloon(const wxString& title,
notifyData = NotifyIconData(hwnd);
notifyData.uFlags |= NIF_INFO;
notifyData.uTimeout = msec;
wxStrncpy(notifyData.szInfo, text.wx_str(), WXSIZEOF(notifyData.szInfo));
wxStrncpy(notifyData.szInfoTitle, title.wx_str(),
wxStrlcpy(notifyData.szInfo, text.wx_str(), WXSIZEOF(notifyData.szInfo));
wxStrlcpy(notifyData.szInfoTitle, title.wx_str(),
WXSIZEOF(notifyData.szInfoTitle));
if ( flags & wxICON_INFORMATION )