Nikolay Sivov : kernel32: Simplify constant string length calculation.

Alexandre Julliard julliard at winehq.org
Wed Aug 28 14:03:08 CDT 2013


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Aug 28 08:36:48 2013 +0400

kernel32: Simplify constant string length calculation.

---

 dlls/kernel32/volume.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c
index 2e0cc8a..72b04df 100644
--- a/dlls/kernel32/volume.c
+++ b/dlls/kernel32/volume.c
@@ -1031,7 +1031,7 @@ BOOL WINAPI GetVolumeNameForVolumeMountPointA( LPCSTR path, LPSTR volume, DWORD
 BOOL WINAPI GetVolumeNameForVolumeMountPointW( LPCWSTR path, LPWSTR volume, DWORD size )
 {
     static const WCHAR prefixW[] = {'\\','D','o','s','D','e','v','i','c','e','s','\\',0};
-    static const WCHAR volumeW[] = {'\\','?','?','\\','V','o','l','u','m','e','{',0};
+    static const WCHAR volumeW[] = {'\\','?','?','\\','V','o','l','u','m','e','{'};
     static const WCHAR trailingW[] = {'\\',0};
 
     MOUNTMGR_MOUNT_POINT *input = NULL, *o1;
@@ -1133,7 +1133,7 @@ BOOL WINAPI GetVolumeNameForVolumeMountPointW( LPCWSTR path, LPWSTR volume, DWOR
             debugstr_wn((WCHAR*)((char *)output + o1->DeviceNameOffset),
                             o1->DeviceNameLength/sizeof(WCHAR)));
 
-        if (!strncmpW( p, volumeW, (sizeof(volumeW)-1)/sizeof(WCHAR) ))
+        if (!strncmpW( p, volumeW, sizeof(volumeW)/sizeof(WCHAR) ))
         {
             /* is there space in the return variable ?? */
             if ((o1->SymbolicLinkNameLength/sizeof(WCHAR))+2 > size)




More information about the wine-cvs mailing list