diff options
author | zuu <zuu@openttd.org> | 2013-01-12 12:48:00 +0000 |
---|---|---|
committer | zuu <zuu@openttd.org> | 2013-01-12 12:48:00 +0000 |
commit | 07ffc90bf4d1afcd5a1a60dd3f4ba5b8e7435cd0 (patch) | |
tree | 1608cb7536b06e00f8197b6565544ee29db00781 | |
parent | 5c242c64a30d4c96d9032d906d8711be354be9cb (diff) | |
download | openttd-07ffc90bf4d1afcd5a1a60dd3f4ba5b8e7435cd0.tar.xz |
(svn r24908) -Fix [FS#5419]: Allow GSs to pass negative integer string parameters (frosch123)
-rw-r--r-- | src/script/api/script_text.cpp | 2 | ||||
-rw-r--r-- | src/strings.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/script/api/script_text.cpp b/src/script/api/script_text.cpp index e9b51e2e7..e5a93168e 100644 --- a/src/script/api/script_text.cpp +++ b/src/script/api/script_text.cpp @@ -183,7 +183,7 @@ char *ScriptText::_GetEncodedText(char *p, char *lastofp) p = this->paramt[i]->_GetEncodedText(p, lastofp); continue; } - p += seprintf(p, lastofp,":%X", this->parami[i]); + p += seprintf(p, lastofp,":%X", (uint32)this->parami[i]); } return p; diff --git a/src/strings.cpp b/src/strings.cpp index 5d1cf3dc1..0973639a4 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -867,7 +867,7 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg bool lookup = (l == SCC_ENCODED); if (lookup) s += len; - param = strtol(s, &p, 16); + param = (int32)strtoul(s, &p, 16); if (lookup) { if (param >= TAB_SIZE) { |