Author: aandrejevic Date: Tue Jun 3 22:34:49 2014 New Revision: 63538
URL: http://svn.reactos.org/svn/reactos?rev=63538&view=rev Log: [NTVDM] Fix the command line NULL-termination.
Modified: trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c
Modified: trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/dos/dos32k... ============================================================================== --- trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] Tue Jun 3 22:34:49 2014 @@ -915,6 +915,7 @@ PIMAGE_DOS_HEADER Header; PDWORD RelocationTable; PWORD RelocWord; + LPSTR CmdLinePtr = (LPSTR)CommandLine;
DPRINT1("DosLoadExecutable(%d, %s, %s, %s, 0x%08X, 0x%08X)\n", LoadType, @@ -931,8 +932,8 @@ }
/* NULL-terminate the command line by removing the return carriage character */ - while (*CommandLine && *CommandLine != '\r') CommandLine++; - *(LPSTR)CommandLine = '\0'; + while (*CmdLinePtr && *CmdLinePtr != '\r') CmdLinePtr++; + *CmdLinePtr = '\0';
/* Open a handle to the executable */ FileHandle = CreateFileA(ExecutablePath,