From b6aaf5fb96db808ae73415c54588e987f66bc242 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 16 May 2015 17:58:06 +0000 Subject: fix for strncat use git-svn-id: http://svn.miranda-ng.org/main/trunk@13630 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/CmdLine/MimCmd/src/commands.cpp | 8 ++++---- plugins/CmdLine/MimCmd/src/common.h | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'plugins/CmdLine/MimCmd/src') diff --git a/plugins/CmdLine/MimCmd/src/commands.cpp b/plugins/CmdLine/MimCmd/src/commands.cpp index eba3893763..6dddcffc43 100644 --- a/plugins/CmdLine/MimCmd/src/commands.cpp +++ b/plugins/CmdLine/MimCmd/src/commands.cpp @@ -141,11 +141,11 @@ void HandleHelpCommand(PCommand helpCommand, char *argv[], int argc, PReply repl for (int i = 0; i < cKnownCommands - 1; i++) { - strncat(reply->message, knownCommands[i].command, size); - strncat(reply->message, ", ", size); + strncat(reply->message, knownCommands[i].command, SIZEOF(reply->message) - mir_strlen(reply->message)); + strncat(reply->message, ", ", SIZEOF(reply->message) - mir_strlen(reply->message)); } - strncat(reply->message, knownCommands[cKnownCommands - 1].command, size); - strncat(reply->message, ".", size); + strncat(reply->message, knownCommands[cKnownCommands - 1].command, SIZEOF(reply->message) - mir_strlen(reply->message)); + strncat(reply->message, ".", SIZEOF(reply->message) - mir_strlen(reply->message)); } } diff --git a/plugins/CmdLine/MimCmd/src/common.h b/plugins/CmdLine/MimCmd/src/common.h index fddbf01649..2b6057ec9c 100644 --- a/plugins/CmdLine/MimCmd/src/common.h +++ b/plugins/CmdLine/MimCmd/src/common.h @@ -27,6 +27,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include +#include +#include #include "..\..\src\mimcmd_ipc.h" #include "version.h" -- cgit v1.2.3