mirror of
https://github.com/reactos/reactos.git
synced 2025-07-10 00:48:00 +00:00
* allocate a terminating zero for every parsed argument
svn path=/trunk/; revision=23549
This commit is contained in:
parent
c20e99d518
commit
9ab72b3399
1 changed files with 1 additions and 1 deletions
|
@ -131,7 +131,7 @@ LPTSTR *WINAPI CommandLineToArgv(LPCTSTR lpCmdLine, int *lpArgc)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allocate space for the pointers in argv and the strings in one block
|
// 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) {
|
if (!argv) {
|
||||||
// Memory allocation failed
|
// Memory allocation failed
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue