From 6b3a26bc407ea66ec30130a271868f185f6aa36e Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sat, 19 Sep 2015 23:31:36 +0200 Subject: Windows: Add extra check in GetDiskDeviceDriveLetter for code clarity --- src/Common/Dlgcode.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c index a5bad787..01f1bc67 100644 --- a/src/Common/Dlgcode.c +++ b/src/Common/Dlgcode.c @@ -7346,10 +7346,12 @@ int GetDiskDeviceDriveLetter (PWSTR deviceName) StringCchCopyW (link, MAX_PATH, L"\\DosDevices\\"); StringCchCatW (link, MAX_PATH, drive); - ResolveSymbolicLink (link, target, sizeof(target)); - - if (wcscmp (device, target) == 0) + if ( ResolveSymbolicLink (link, target, sizeof(target)) + && (wcscmp (device, target) == 0) + ) + { return i; + } } return -1; -- cgit v1.2.3