Alexandre Julliard : taskmgr: Avoid wcsncpy().

Alexandre Julliard julliard at winehq.org
Tue May 4 16:23:35 CDT 2021


Module: wine
Branch: master
Commit: 85846bfbf4152e7c89ef3415366d70fc44a2265d
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=85846bfbf4152e7c89ef3415366d70fc44a2265d

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue May  4 21:22:20 2021 +0200

taskmgr: Avoid wcsncpy().

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/taskmgr/perfdata.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/programs/taskmgr/perfdata.c b/programs/taskmgr/perfdata.c
index 2cbd6b01669..4498a2fe1f1 100644
--- a/programs/taskmgr/perfdata.c
+++ b/programs/taskmgr/perfdata.c
@@ -328,7 +328,7 @@ BOOL PerfDataGetImageName(ULONG Index, LPWSTR lpImageName, int nMaxCount)
     EnterCriticalSection(&PerfDataCriticalSection);
 
     if (Index < ProcessCount) {
-        wcsncpy(lpImageName, pPerfData[Index].ImageName, nMaxCount);
+        lstrcpynW(lpImageName, pPerfData[Index].ImageName, nMaxCount);
         if (pPerfData[Index].Wow64Process &&
             nMaxCount - lstrlenW(lpImageName) > 4 /* =lstrlenW(proc32W) */)
             lstrcatW(lpImageName, proc32W);
@@ -363,7 +363,7 @@ BOOL PerfDataGetUserName(ULONG Index, LPWSTR lpUserName, int nMaxCount)
     EnterCriticalSection(&PerfDataCriticalSection);
 
     if (Index < ProcessCount) {
-        wcsncpy(lpUserName, pPerfData[Index].UserName, nMaxCount);
+        lstrcpynW(lpUserName, pPerfData[Index].UserName, nMaxCount);
         bSuccessful = TRUE;
     } else {
         bSuccessful = FALSE;




More information about the wine-cvs mailing list