summaryrefslogtreecommitdiff
path: root/src/console.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-09-29 16:27:02 +0000
committerrubidium <rubidium@openttd.org>2008-09-29 16:27:02 +0000
commite7829c1a57014f8b40b4972ab5b45dbcf4bb067d (patch)
tree43b0c8873ef3d08bb3099e46a3bc152bc8cd010d /src/console.cpp
parenta25d9bcc8b771e365097d96a459bca1b36c53408 (diff)
downloadopenttd-e7829c1a57014f8b40b4972ab5b45dbcf4bb067d.tar.xz
(svn r14414) -Fix: replace instances of strncpy with strecpy as strncpy doesn't guarantee the resulting string is '\0'-terminated.
Diffstat (limited to 'src/console.cpp')
-rw-r--r--src/console.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/console.cpp b/src/console.cpp
index a9f2d20c3..48bb2f941 100644
--- a/src/console.cpp
+++ b/src/console.cpp
@@ -389,7 +389,7 @@ IConsoleAlias *IConsoleAliasGet(const char *name)
static inline int IConsoleCopyInParams(char *dst, const char *src, uint bufpos)
{
int len = min(ICON_MAX_STREAMSIZE - bufpos, (uint)strlen(src));
- strncpy(dst, src, len);
+ strecpy(dst, src, dst + len - 1);
return len;
}