[mvdm] Fix missing pointer dereference
authorAndrew Cook <ariscop@gmail.com>
Sat, 9 Feb 2019 04:08:08 +0000 (15:08 +1100)
committerMark Jansen <mark.jansen@reactos.org>
Sat, 9 Feb 2019 10:53:55 +0000 (11:53 +0100)
Original code compared against the pointer value rather
than the first byte

subsystems/mvdm/ntvdm/console/console.c
subsystems/mvdm/ntvdm/emulator.c

index db2a468..7901a25 100644 (file)
@@ -169,7 +169,7 @@ UpdateVdmMenuDisks(VOID)
 
         if (GlobalSettings.FloppyDisks[i].Length != 0 &&
             GlobalSettings.FloppyDisks[i].Buffer      &&
-            GlobalSettings.FloppyDisks[i].Buffer != L'\0')
+           *GlobalSettings.FloppyDisks[i].Buffer != L'\0')
         {
             /* Update item text */
             _snwprintf(szMenuString2, ARRAYSIZE(szMenuString2), szMenuString1, i, GlobalSettings.FloppyDisks[i].Buffer);
index 2a6b186..68ff9f3 100644 (file)
@@ -592,7 +592,7 @@ BOOLEAN EmulatorInitialize(HANDLE ConsoleInput, HANDLE ConsoleOutput)
     {
         if (GlobalSettings.FloppyDisks[i].Length != 0 &&
             GlobalSettings.FloppyDisks[i].Buffer      &&
-            GlobalSettings.FloppyDisks[i].Buffer != '\0')
+           *GlobalSettings.FloppyDisks[i].Buffer != L'\0')
         {
             if (!MountDisk(FLOPPY_DISK, i, GlobalSettings.FloppyDisks[i].Buffer, FALSE))
             {
@@ -611,7 +611,7 @@ BOOLEAN EmulatorInitialize(HANDLE ConsoleInput, HANDLE ConsoleOutput)
     {
         if (GlobalSettings.HardDisks[i].Length != 0 &&
             GlobalSettings.HardDisks[i].Buffer      &&
-            GlobalSettings.HardDisks[i].Buffer != L'\0')
+           *GlobalSettings.HardDisks[i].Buffer != L'\0')
         {
             if (!MountDisk(HARD_DISK, i, GlobalSettings.HardDisks[i].Buffer, FALSE))
             {