Windows: Add extra check in GetDiskDeviceDriveLetter for code clarity

This commit is contained in:
Mounir IDRASSI committed 2015-09-26 17:43:43 +02:00
1 parent e8ea23e719
commit 6b3a26bc40
1 file changed
+5 -3
+5 -3
View File
@@ -7346,11 +7346,13 @@ int GetDiskDeviceDriveLetter (PWSTR deviceName)
StringCchCopyW (link, MAX_PATH, L"\\DosDevices\\"); StringCchCopyW (link, MAX_PATH, L"\\DosDevices\\");
StringCchCatW (link, MAX_PATH, drive); StringCchCatW (link, MAX_PATH, drive);
ResolveSymbolicLink (link, target, sizeof(target)); if ( ResolveSymbolicLink (link, target, sizeof(target))
&& (wcscmp (device, target) == 0)
if (wcscmp (device, target) == 0) )
{
return i; return i;
} }
}
return -1; return -1;
} }