Alex Henrie : version: Simplify null check in VerQueryValueW.

Alexandre Julliard julliard at winehq.org
Tue Oct 30 14:19:34 CDT 2018


Module: wine
Branch: master
Commit: 15e9bbe13ab17340d8b2c50a749dee7a9e0c089a
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=15e9bbe13ab17340d8b2c50a749dee7a9e0c089a

Author: Alex Henrie <alexhenrie24 at gmail.com>
Date:   Mon Oct 29 22:41:53 2018 -0600

version: Simplify null check in VerQueryValueW.

Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/version/version.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/dlls/version/version.c b/dlls/version/version.c
index 5299ecd..bd03b2b 100644
--- a/dlls/version/version.c
+++ b/dlls/version/version.c
@@ -1054,7 +1054,6 @@ BOOL WINAPI VerQueryValueA( LPCVOID pBlock, LPCSTR lpSubBlock,
 BOOL WINAPI VerQueryValueW( LPCVOID pBlock, LPCWSTR lpSubBlock,
                                LPVOID *lplpBuffer, PUINT puLen )
 {
-    static const WCHAR nullW[] = { 0 };
     static const WCHAR rootW[] = { '\\', 0 };
     static const WCHAR varfileinfoW[] = { '\\','V','a','r','F','i','l','e','I','n','f','o',
                                           '\\','T','r','a','n','s','l','a','t','i','o','n', 0 };
@@ -1067,7 +1066,7 @@ BOOL WINAPI VerQueryValueW( LPCVOID pBlock, LPCWSTR lpSubBlock,
     if (!pBlock)
         return FALSE;
 
-    if (lpSubBlock == NULL || lpSubBlock[0] == nullW[0])
+    if (!lpSubBlock || !lpSubBlock[0])
         lpSubBlock = rootW;
 
     if ( VersionInfoIs16( info ) )




More information about the wine-cvs mailing list