summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2005-05-06 18:34:28 +0000
committerDarkvater <Darkvater@openttd.org>2005-05-06 18:34:28 +0000
commit2c01a244742f5c53a3f45737a88ad30783c7f7d8 (patch)
treeed50cb5e89cd487406918fee0acbbc6ed6e8e360
parent132f8673db3ae34462bad7744005fb2a75d890ca (diff)
downloadopenttd-2c01a244742f5c53a3f45737a88ad30783c7f7d8.tar.xz
(svn r2275) - Fix: [ 1196662 ] scrollto doesn't accept hexadecimal numbers
-rw-r--r--console.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/console.c b/console.c
index cc56815c2..778be52e1 100644
--- a/console.c
+++ b/console.c
@@ -450,7 +450,8 @@ bool GetArgumentInteger(uint32 *value, const char *arg)
{
int result = sscanf(arg, "%u", value);
- if (result == 0 && arg[0] == '0' && (arg[1] == 'x' || arg[1] == 'X'))
+ /* Hexadecimal numbers start with 0x, so at least the first number has been parsed */
+ if (result == 1 && arg[0] == '0' && (arg[1] == 'x' || arg[1] == 'X'))
result = sscanf(arg, "%x", value);
if (result == 0 && (strcmp(arg, "on") == 0 || strcmp(arg, "true") == 0 )) {*value = 1; result = 1;}