changeset 19976:18914225ef04 draft

(svn r24908) -Fix [FS#5419]: Allow GSs to pass negative integer string parameters (frosch123)
author zuu <zuu@openttd.org>
date Sat, 12 Jan 2013 12:48:00 +0000
parents 972b46231b8a
children d51dadbee100
files src/script/api/script_text.cpp src/strings.cpp
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/script/api/script_text.cpp
+++ b/src/script/api/script_text.cpp
@@ -183,7 +183,7 @@
 			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;
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -867,7 +867,7 @@
 						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) {