diff options
author | rubidium <rubidium@openttd.org> | 2008-09-28 13:50:11 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-09-28 13:50:11 +0000 |
commit | fc1ad6871490062dee9b0eb562a7d3552aeb5cba (patch) | |
tree | ac9f9beb01979a9afd4b4a144489e33ac8083baa /src/strings.cpp | |
parent | b588578bcc20c2b000f16222643a64250a836fb6 (diff) | |
download | openttd-fc1ad6871490062dee9b0eb562a7d3552aeb5cba.tar.xz |
(svn r14410) -Codechange: one can't inject a negative number of parameters, so enforce this by using a uint.
Diffstat (limited to 'src/strings.cpp')
-rw-r--r-- | src/strings.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/strings.cpp b/src/strings.cpp index 6e9665ad9..5d0fa5675 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -191,8 +191,9 @@ void SetDParamStr(uint n, const char *str) SetDParam(n, (uint64)(size_t)str); } -void InjectDParam(int amount) +void InjectDParam(uint amount) { + assert((uint)amount < lengthof(_decode_parameters)); memmove(_decode_parameters + amount, _decode_parameters, sizeof(_decode_parameters) - amount * sizeof(uint64)); } |