From 7fded8889577385d6595a18b3dd00c73dba23bf3 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 1 May 2012 15:06:32 +0200 Subject: [PATCH] oleaut32: SysStringLen code clean up. --- dlls/oleaut32/oleaut.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/dlls/oleaut32/oleaut.c b/dlls/oleaut32/oleaut.c index 8cbc819a0ce..0d4a07c9e16 100644 --- a/dlls/oleaut32/oleaut.c +++ b/dlls/oleaut32/oleaut.c @@ -152,18 +152,7 @@ static DWORD *alloc_bstr(size_t size) */ UINT WINAPI SysStringLen(BSTR str) { - DWORD* bufferPointer; - - if (!str) return 0; - /* - * The length of the string (in bytes) is contained in a DWORD placed - * just before the BSTR pointer - */ - bufferPointer = (DWORD*)str; - - bufferPointer--; - - return (int)(*bufferPointer/sizeof(WCHAR)); + return str ? *((DWORD*)str-1)/sizeof(WCHAR) : 0; } /******************************************************************************