[ros-diffs] [janderwald] 27955: - fix cmd not to crash when just typing "start" [enter] See issue #2294 for more details.
janderwald at svn.reactos.org
janderwald at svn.reactos.org
Sat Jul 28 19:48:24 CEST 2007
Author: janderwald
Date: Sat Jul 28 21:48:23 2007
New Revision: 27955
URL: http://svn.reactos.org/svn/reactos?rev=27955&view=rev
Log:
- fix cmd not to crash when just typing "start" [enter]
See issue #2294 for more details.
Modified:
trunk/reactos/base/shell/cmd/start.c
Modified: trunk/reactos/base/shell/cmd/start.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/start.c?rev=27955&r1=27954&r2=27955&view=diff
==============================================================================
--- trunk/reactos/base/shell/cmd/start.c (original)
+++ trunk/reactos/base/shell/cmd/start.c Sat Jul 28 21:48:23 2007
@@ -97,7 +97,7 @@
return 1;
}
SetLastError(0);
- size = GetEnvironmentVariable (_T("COMSPEC"), comspec, 512);
+ size = GetEnvironmentVariable (_T("COMSPEC"), comspec, MAX_PATH);
if(GetLastError() == ERROR_ENVVAR_NOT_FOUND)
{
RestWithoutArgs[0] = _T('c');
@@ -127,7 +127,7 @@
_tcscat(RestWithoutArgs,_T("\""));
}
- rest = malloc ( _tcslen(RestWithoutArgs) + 1 * sizeof(TCHAR));
+ rest = malloc ( (_tcslen(RestWithoutArgs) + 1) * sizeof(TCHAR));
if (rest == NULL)
{
if(comspec != NULL)
@@ -136,7 +136,7 @@
return 1;
}
- param =malloc ( _tcslen(RestWithoutArgs) + 1 * sizeof(TCHAR));
+ param =malloc ( (_tcslen(RestWithoutArgs) + 1) * sizeof(TCHAR));
if (rest == NULL)
{
if(comspec != NULL)
More information about the Ros-diffs
mailing list