Marcus Meissner : combase: Reorder checks (Coverity).

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jan 13 15:01:25 CST 2015


Module: wine
Branch: master
Commit: a20e75432e86c7dffe8abc458cebbb617888543b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a20e75432e86c7dffe8abc458cebbb617888543b

Author: Marcus Meissner <marcus at jet.franken.de>
Date:   Sun Jan 11 23:37:03 2015 +0100

combase: Reorder checks (Coverity).

---

 dlls/combase/string.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/combase/string.c b/dlls/combase/string.c
index 9ec05c6..7054af6 100644
--- a/dlls/combase/string.c
+++ b/dlls/combase/string.c
@@ -99,13 +99,13 @@ HRESULT WINAPI WindowsCreateStringReference(LPCWSTR ptr, UINT32 len,
         return E_INVALIDARG;
     if (ptr == NULL && len > 0)
         return E_POINTER;
-    if (ptr[len] != '\0')
-        return E_INVALIDARG;
     if (len == 0)
     {
         *out = NULL;
         return S_OK;
     }
+    if (ptr[len] != '\0')
+        return E_INVALIDARG;
     priv->buffer = (LPWSTR)ptr;
     priv->length = len;
     priv->reference = TRUE;




More information about the wine-cvs mailing list