Author: hbelusca Date: Sat May 3 18:07:07 2014 New Revision: 63138
URL: http://svn.reactos.org/svn/reactos?rev=63138&view=rev Log: [CMD] Fix _tcsncat usage. Patch by Victor Martinez. CORE-8149 #resolve
Modified: trunk/reactos/base/shell/cmd/cmd.c
Modified: trunk/reactos/base/shell/cmd/cmd.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/cmd/cmd.c?rev=63... ============================================================================== --- trunk/reactos/base/shell/cmd/cmd.c [iso-8859-1] (original) +++ trunk/reactos/base/shell/cmd/cmd.c [iso-8859-1] Sat May 3 18:07:07 2014 @@ -397,13 +397,13 @@ /* build command line for CreateProcess(): FullName + " " + rest */ BOOL quoted = !!_tcschr(First, ' '); _tcscpy(szFullCmdLine, quoted ? _T(""") : _T("")); - _tcsncat(szFullCmdLine, First, CMDLINE_LENGTH - _tcslen(szFullCmdLine)); - _tcsncat(szFullCmdLine, quoted ? _T(""") : _T(""), CMDLINE_LENGTH - _tcslen(szFullCmdLine)); + _tcsncat(szFullCmdLine, First, CMDLINE_LENGTH - _tcslen(szFullCmdLine) - 1); + _tcsncat(szFullCmdLine, quoted ? _T(""") : _T(""), CMDLINE_LENGTH - _tcslen(szFullCmdLine) - 1);
if (*rest) { - _tcsncat(szFullCmdLine, _T(" "), CMDLINE_LENGTH - _tcslen(szFullCmdLine)); - _tcsncat(szFullCmdLine, rest, CMDLINE_LENGTH - _tcslen(szFullCmdLine)); + _tcsncat(szFullCmdLine, _T(" "), CMDLINE_LENGTH - _tcslen(szFullCmdLine) - 1); + _tcsncat(szFullCmdLine, rest, CMDLINE_LENGTH - _tcslen(szFullCmdLine) - 1); }
TRACE ("[EXEC: %s]\n", debugstr_aw(szFullCmdLine));