properly zero terminate the buffer in GetComputerName

svn path=/trunk/; revision=36032
This commit is contained in:
Christoph von Wittich 2008-09-07 14:04:18 +00:00
parent d2b37f54df
commit 90cdd4f331

View file

@ -94,9 +94,8 @@ static BOOL GetComputerNameFromRegistry( LPWSTR RegistryKey,
}
if( *nSize > (KeyInfo->DataLength / sizeof(WCHAR)) ) {
*nSize = KeyInfo->DataLength / sizeof(WCHAR);
*nSize = KeyInfo->DataLength / sizeof(WCHAR) - 1;
lpBuffer[*nSize] = 0;
(*nSize)--;
}
RtlCopyMemory (lpBuffer,