Commit 15b17a0e authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

shlwapi: Avoid a temporary variable.

parent d33f0674
...@@ -491,7 +491,6 @@ HANDLE WINAPI SHGlobalCounterCreateNamedW(LPCWSTR lpszName, DWORD iInitial) ...@@ -491,7 +491,6 @@ HANDLE WINAPI SHGlobalCounterCreateNamedW(LPCWSTR lpszName, DWORD iInitial)
static const WCHAR szPrefix[] = { 's', 'h', 'e', 'l', 'l', '.', '\0' }; static const WCHAR szPrefix[] = { 's', 'h', 'e', 'l', 'l', '.', '\0' };
const int iPrefixLen = 6; const int iPrefixLen = 6;
WCHAR szBuff[MAX_PATH]; WCHAR szBuff[MAX_PATH];
const int iBuffLen = sizeof(szBuff)/sizeof(WCHAR);
SECURITY_DESCRIPTOR sd; SECURITY_DESCRIPTOR sd;
SECURITY_ATTRIBUTES sAttr, *pSecAttr; SECURITY_ATTRIBUTES sAttr, *pSecAttr;
HANDLE hRet; HANDLE hRet;
...@@ -501,7 +500,7 @@ HANDLE WINAPI SHGlobalCounterCreateNamedW(LPCWSTR lpszName, DWORD iInitial) ...@@ -501,7 +500,7 @@ HANDLE WINAPI SHGlobalCounterCreateNamedW(LPCWSTR lpszName, DWORD iInitial)
/* Create Semaphore name */ /* Create Semaphore name */
memcpy(szBuff, szPrefix, (iPrefixLen + 1) * sizeof(WCHAR)); memcpy(szBuff, szPrefix, (iPrefixLen + 1) * sizeof(WCHAR));
if (lpszName) if (lpszName)
StrCpyNW(szBuff + iPrefixLen, lpszName, iBuffLen - iPrefixLen); StrCpyNW(szBuff + iPrefixLen, lpszName, ARRAY_SIZE(szBuff) - iPrefixLen);
/* Initialise security attributes */ /* Initialise security attributes */
pSecAttr = CreateAllAccessSecurityAttributes(&sAttr, &sd, 0); pSecAttr = CreateAllAccessSecurityAttributes(&sAttr, &sd, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment