From 07ffc90bf4d1afcd5a1a60dd3f4ba5b8e7435cd0 Mon Sep 17 00:00:00 2001 From: zuu Date: Sat, 12 Jan 2013 12:48:00 +0000 Subject: [PATCH] (svn r24908) -Fix [FS#5419]: Allow GSs to pass negative integer string parameters (frosch123) --- src/script/api/script_text.cpp | 2 +- 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 e9b51e2e7f..e5a93168e8 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 5d1cf3dc1a..0973639a46 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) {