summaryrefslogtreecommitdiff
path: root/src/console.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-10-02 00:08:45 +0000
committerrubidium <rubidium@openttd.org>2008-10-02 00:08:45 +0000
commitdcfa5a71aa67cc5879dcd10d29294b6c7725c2b1 (patch)
treed847df290f7b9592afe6672d3ea77f73bc61781a /src/console.cpp
parent166793bd93c3faed311bfa34126149d142e44b7e (diff)
downloadopenttd-dcfa5a71aa67cc5879dcd10d29294b6c7725c2b1.tar.xz
(svn r14431) -Fix (r14414): alias parameter "evaluation" would remove the last byte of the parameters.
Diffstat (limited to 'src/console.cpp')
-rw-r--r--src/console.cpp5
1 files changed, 3 insertions, 2 deletions
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;
}