From dcfa5a71aa67cc5879dcd10d29294b6c7725c2b1 Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 2 Oct 2008 00:08:45 +0000 Subject: (svn r14431) -Fix (r14414): alias parameter "evaluation" would remove the last byte of the parameters. --- src/console.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/console.cpp b/src/console.cpp index 60851cc2f..3cc11f31b 100644 --- a/src/console.cpp +++ b/src/console.cpp @@ -388,8 +388,9 @@ IConsoleAlias *IConsoleAliasGet(const char *name) /** copy in an argument into the aliasstream */ static inline int IConsoleCopyInParams(char *dst, const char *src, uint bufpos) { - int len = min(ICON_MAX_STREAMSIZE - bufpos, (uint)strlen(src)); - strecpy(dst, src, dst + len - 1); + /* len is the amount of bytes to add excluding the '\0'-termination */ + int len = min(ICON_MAX_STREAMSIZE - bufpos - 1, (uint)strlen(src)); + strecpy(dst, src, dst + len); return len; } -- cgit v1.2.3-70-g09d2