https://git.reactos.org/?p=reactos.git;a=commitdiff;h=04498f3eb52a7d5f960d0…
commit 04498f3eb52a7d5f960d096f53be8808dc68dd93
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Feb 4 01:56:11 2018 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sun Feb 4 01:57:05 2018 +0100
[EXPLORER] Don't use deprecated StrNCpy function but use the string-safe
StringCchCopy instead. Also fix a copy-paste error in the _countofs.
---
base/shell/explorer/syspager.cpp | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/base/shell/explorer/syspager.cpp b/base/shell/explorer/syspager.cpp
index 4656d8f6fa..9ba0f2fc99 100644
--- a/base/shell/explorer/syspager.cpp
+++ b/base/shell/explorer/syspager.cpp
@@ -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;
}