Author: cwittich Date: Mon Oct 20 09:21:08 2014 New Revision: 64842
URL: http://svn.reactos.org/svn/reactos?rev=64842&view=rev Log: [cmd/help] do not call wcslen on uninitialized variable
Modified: trunk/reactos/base/applications/cmdutils/help/help.c
Modified: trunk/reactos/base/applications/cmdutils/help/help.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils/... ============================================================================== --- trunk/reactos/base/applications/cmdutils/help/help.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/help/help.c [iso-8859-1] Mon Oct 20 09:21:08 2014 @@ -16,6 +16,7 @@ #include <winbase.h> #include <winuser.h> #include <wincon.h> +#include <strsafe.h>
#include "help.h" #include "resource.h" @@ -135,9 +136,8 @@ /* * Run "<command> /?" in the current command processor. */ - wcsncpy(CmdLine, argv[1], CMDLINE_LENGTH - wcslen(CmdLine)); - wcsncat(CmdLine, L" /?" , CMDLINE_LENGTH - wcslen(CmdLine)); - + StringCbPrintfW(CmdLine, sizeof(CmdLine), L"%ls /?", argv[1]); + _flushall(); return _wsystem(CmdLine); }