From 4fc66185ff340890a3c2da1ab937462d15eccdaa Mon Sep 17 00:00:00 2001 From: peter1138 Date: Fri, 10 Oct 2008 10:25:10 +0000 Subject: [PATCH] (svn r14455) [0.6] -Backport from trunk: - Fix: Alias parameter "evaluation" would remove the last byte of the parameters (r14431) --- src/console.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/console.cpp b/src/console.cpp index 350dd95fdb..0be9c8cbae 100644 --- a/src/console.cpp +++ b/src/console.cpp @@ -696,8 +696,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; }