combase: Simplify NULL pointer check in WindowsCreateString[Reference].

Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sebastian Lackner 2015-10-25 15:32:26 +01:00 committed by Alexandre Julliard
parent 1173967ea9
commit 8a870d4965
1 changed files with 4 additions and 4 deletions

View File

@ -79,13 +79,13 @@ HRESULT WINAPI WindowsCreateString(LPCWSTR ptr, UINT32 len,
if (out == NULL)
return E_INVALIDARG;
if (ptr == NULL && len > 0)
return E_POINTER;
if (len == 0)
{
*out = NULL;
return S_OK;
}
if (ptr == NULL)
return E_POINTER;
if (!alloc_string(len, out))
return E_OUTOFMEMORY;
priv = impl_from_HSTRING(*out);
@ -105,13 +105,13 @@ HRESULT WINAPI WindowsCreateStringReference(LPCWSTR ptr, UINT32 len,
if (out == NULL || header == NULL)
return E_INVALIDARG;
if (ptr == NULL && len > 0)
return E_POINTER;
if (len == 0)
{
*out = NULL;
return S_OK;
}
if (ptr == NULL)
return E_POINTER;
if (ptr[len] != '\0')
return E_INVALIDARG;
priv->buffer = (LPWSTR)ptr;