aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorMax Horn2006-04-15 13:58:01 +0000
committerMax Horn2006-04-15 13:58:01 +0000
commitebea155b8ebe6a92701aa40155e548bc59f12dbb (patch)
treeff21ac834f5f8144934818fef3a53fec264d02c5 /base
parentc07fc494d2d4d06459b7381ce028d0ad2a387b4e (diff)
downloadscummvm-rg350-ebea155b8ebe6a92701aa40155e548bc59f12dbb.tar.gz
scummvm-rg350-ebea155b8ebe6a92701aa40155e548bc59f12dbb.tar.bz2
scummvm-rg350-ebea155b8ebe6a92701aa40155e548bc59f12dbb.zip
Always use base 0 in strtol when parsing integer command line options / config file entries (this makes it possible to optionally use hex values)
svn-id: r21911
Diffstat (limited to 'base')
-rw-r--r--base/gameDetector.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp
index 4139b54d99..eec3d69276 100644
--- a/base/gameDetector.cpp
+++ b/base/gameDetector.cpp
@@ -294,7 +294,7 @@ GameDescriptor GameDetector::findGame(const String &gameName, const Plugin **plu
DO_OPTION_OPT(shortCmd, longCmd, 0) \
if (!option) usage("Option '%s' requires an argument", argv[i]); \
char *endptr = 0; \
- int intValue; intValue = (int)strtol(option, &endptr, 10); \
+ int intValue; intValue = (int)strtol(option, &endptr, 0); \
if (endptr == NULL || *endptr != 0) usage("--%s: Invalid number '%s'", longCmd, option);
// Use this for boolean options; this distinguishes between "-x" and "-X",
@@ -508,14 +508,7 @@ Common::String GameDetector::parseCommandLine(Common::StringMap &settings, int a
END_OPTION
#ifndef DISABLE_SCUMM
- DO_LONG_OPTION("tempo")
- // Use the special value '0' for the base in (int)strtol.
- // Doing that makes it possible to enter hex values
- // as "0x1234", but also decimal values ("123").
- int value = (int)strtol(option, 0, 0);
- char buf[20];
- snprintf(buf, sizeof(buf), "%d", value);
- settings["tempo"] = buf;
+ DO_LONG_OPTION_INT("tempo")
END_OPTION
DO_LONG_OPTION_BOOL("demo-mode")