mirror of
https://github.com/reactos/reactos.git
synced 2024-10-10 19:27:40 +00:00
* allocate a terminating zero for every parsed argument
svn path=/trunk/; revision=23549
This commit is contained in:
parent
c20e99d518
commit
9ab72b3399
|
@ -131,7 +131,7 @@ LPTSTR *WINAPI CommandLineToArgv(LPCTSTR lpCmdLine, int *lpArgc)
|
|||
}
|
||||
|
||||
// Allocate space for the pointers in argv and the strings in one block
|
||||
argv = (LPTSTR *)malloc(argc * sizeof(LPTSTR) + (_tcslen(lpArg) + 1) * sizeof(TCHAR));
|
||||
argv = (LPTSTR *)malloc(argc * sizeof(LPTSTR) + (_tcslen(lpArg) + argc) * sizeof(TCHAR));
|
||||
|
||||
if (!argv) {
|
||||
// Memory allocation failed
|
||||
|
|
Loading…
Reference in a new issue