* allocate a terminating zero for every parsed argument

svn path=/trunk/; revision=23549
This commit is contained in:
Johannes Anderwald 2006-08-12 14:17:44 +00:00
parent c20e99d518
commit 9ab72b3399

View file

@ -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