diff --git a/base/shell/cmd/cmd.c b/base/shell/cmd/cmd.c index bc92e70e6c2..974fd3e6266 100644 --- a/base/shell/cmd/cmd.c +++ b/base/shell/cmd/cmd.c @@ -382,7 +382,8 @@ Execute(LPTSTR Full, LPTSTR First, LPTSTR Rest, PARSED_COMMAND *Cmd) /* Save the original console title and build a new one */ GetConsoleTitle(szWindowTitle, ARRAYSIZE(szWindowTitle)); bTitleSet = FALSE; - _stprintf(szNewTitle, _T("%s - %s%s"), szWindowTitle, First, Rest); + StringCchPrintf(szNewTitle, ARRAYSIZE(szNewTitle), + _T("%s - %s%s"), szWindowTitle, First, Rest); ConSetTitle(szNewTitle); /* check if this is a .BAT or .CMD file */ diff --git a/base/shell/cmd/precomp.h b/base/shell/cmd/precomp.h index a8e1418bbe7..7c0e76dc3da 100644 --- a/base/shell/cmd/precomp.h +++ b/base/shell/cmd/precomp.h @@ -25,6 +25,8 @@ #define NTOS_MODE_USER #include +#include + #include #include "resource.h"