diff options
author | rubidium <rubidium@openttd.org> | 2008-10-02 00:08:45 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-10-02 00:08:45 +0000 |
commit | d19d6f21a0810f80ebc8bae8ea283e06038bb000 (patch) | |
tree | d847df290f7b9592afe6672d3ea77f73bc61781a /src/console.cpp | |
parent | ba5575e0fc5d3b1314def4e9121a6b92207455ce (diff) | |
download | openttd-d19d6f21a0810f80ebc8bae8ea283e06038bb000.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.cpp | 5 |
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; } |