diff options
author | rubidium <rubidium@openttd.org> | 2008-09-29 16:27:02 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-09-29 16:27:02 +0000 |
commit | 5ab74534da3f94cd1c43bc438dcc0d31b23408e5 (patch) | |
tree | 43b0c8873ef3d08bb3099e46a3bc152bc8cd010d /src/console.cpp | |
parent | d34da3cadbd0e7776244fc45915f23b1e9f28c7f (diff) | |
download | openttd-5ab74534da3f94cd1c43bc438dcc0d31b23408e5.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.cpp | 2 |
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; } |