VeraCrypt
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Common/Dlgcode.c8
1 files 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;