[EXPLORER] Don't use deprecated StrNCpy function but use the string-safe StringCchCopy instead. Also fix a copy-paste error in the _countofs.

This commit is contained in:
Hermès Bélusca-Maïto 2018-02-04 01:56:11 +01:00
parent b7c3398f95
commit 04498f3eb5
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -107,8 +107,8 @@ private:
Info(InternalIconData * source)
{
pSource = source;
StrNCpy(szInfo, source->szInfo, _countof(szInfo));
StrNCpy(szInfoTitle, source->szInfoTitle, _countof(szInfoTitle));
StringCchCopy(szInfo, _countof(szInfo), source->szInfo);
StringCchCopy(szInfoTitle, _countof(szInfoTitle), source->szInfoTitle);
uIcon = source->dwInfoFlags & NIIF_ICON_MASK;
if (source->dwInfoFlags == NIIF_USER)
uIcon = reinterpret_cast<WPARAM>(source->hIcon);
@ -775,8 +775,8 @@ BOOL CNotifyToolbar::AddButton(_In_ CONST NOTIFYICONDATA *iconData)
if (iconData->uFlags & NIF_INFO)
{
// NOTE: In Vista+, the uTimeout value is disregarded, and the accessibility settings are used always.
StrNCpy(notifyItem->szInfo, iconData->szInfo, _countof(notifyItem->szInfo));
StrNCpy(notifyItem->szInfoTitle, iconData->szInfoTitle, _countof(notifyItem->szInfo));
StringCchCopy(notifyItem->szInfo, _countof(notifyItem->szInfo), iconData->szInfo);
StringCchCopy(notifyItem->szInfoTitle, _countof(notifyItem->szInfoTitle), iconData->szInfoTitle);
notifyItem->dwInfoFlags = iconData->dwInfoFlags;
notifyItem->uTimeout = iconData->uTimeout;
}
@ -913,8 +913,8 @@ BOOL CNotifyToolbar::UpdateButton(_In_ CONST NOTIFYICONDATA *iconData)
if (iconData->uFlags & NIF_INFO)
{
// NOTE: In Vista+, the uTimeout value is disregarded, and the accessibility settings are used always.
StrNCpy(notifyItem->szInfo, iconData->szInfo, _countof(notifyItem->szInfo));
StrNCpy(notifyItem->szInfoTitle, iconData->szInfoTitle, _countof(notifyItem->szInfo));
StringCchCopy(notifyItem->szInfo, _countof(notifyItem->szInfo), iconData->szInfo);
StringCchCopy(notifyItem->szInfoTitle, _countof(notifyItem->szInfoTitle), iconData->szInfoTitle);
notifyItem->dwInfoFlags = iconData->dwInfoFlags;
notifyItem->uTimeout = iconData->uTimeout;
}