Michael Stefaniuc : shlwapi: Avoid a temporary variable.
Module: wine Branch: master Commit: 15b17a0e4bbe2385eb17c4b10786aa49092526ea URL: https://source.winehq.org/git/wine.git/?a=commit;h=15b17a0e4bbe2385eb17c4b10... Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Sat Sep 15 00:10:29 2018 +0200 shlwapi: Avoid a temporary variable. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shlwapi/thread.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/shlwapi/thread.c b/dlls/shlwapi/thread.c index eb2c35d..5726b85 100644 --- a/dlls/shlwapi/thread.c +++ b/dlls/shlwapi/thread.c @@ -491,7 +491,6 @@ HANDLE WINAPI SHGlobalCounterCreateNamedW(LPCWSTR lpszName, DWORD iInitial) static const WCHAR szPrefix[] = { 's', 'h', 'e', 'l', 'l', '.', '\0' }; const int iPrefixLen = 6; WCHAR szBuff[MAX_PATH]; - const int iBuffLen = sizeof(szBuff)/sizeof(WCHAR); SECURITY_DESCRIPTOR sd; SECURITY_ATTRIBUTES sAttr, *pSecAttr; HANDLE hRet; @@ -501,7 +500,7 @@ HANDLE WINAPI SHGlobalCounterCreateNamedW(LPCWSTR lpszName, DWORD iInitial) /* Create Semaphore name */ memcpy(szBuff, szPrefix, (iPrefixLen + 1) * sizeof(WCHAR)); if (lpszName) - StrCpyNW(szBuff + iPrefixLen, lpszName, iBuffLen - iPrefixLen); + StrCpyNW(szBuff + iPrefixLen, lpszName, ARRAY_SIZE(szBuff) - iPrefixLen); /* Initialise security attributes */ pSecAttr = CreateAllAccessSecurityAttributes(&sAttr, &sd, 0);
participants (1)
-
Alexandre Julliard