aboutsummaryrefslogtreecommitdiff
path: root/base/commandLine.cpp
diff options
context:
space:
mode:
authorLittleboy2011-06-23 05:42:48 -0400
committerLittleboy2011-06-23 08:52:52 -0400
commitb694a78f62a02253bca2a5611314599ae7fce725 (patch)
tree115573b00e3b025ed334f9eadeadfb6161286089 /base/commandLine.cpp
parent7a96e0bfb67e9b5b8c0aa9bdae8415fb98214c3f (diff)
downloadscummvm-rg350-b694a78f62a02253bca2a5611314599ae7fce725.tar.gz
scummvm-rg350-b694a78f62a02253bca2a5611314599ae7fce725.tar.bz2
scummvm-rg350-b694a78f62a02253bca2a5611314599ae7fce725.zip
ANALYSIS: Add static casts to is* functions
This fixes a potential problem with passing char values that would be sign-extended and yield unexpected results. See http://msdn.microsoft.com/en-us/library/ms245348.aspx
Diffstat (limited to 'base/commandLine.cpp')
-rw-r--r--base/commandLine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/base/commandLine.cpp b/base/commandLine.cpp
index 6cb858525e..2620d69ba2 100644
--- a/base/commandLine.cpp
+++ b/base/commandLine.cpp
@@ -279,7 +279,7 @@ void registerDefaults() {
// resp. between "--some-option" and "--no-some-option".
#define DO_OPTION_BOOL(shortCmd, longCmd) \
if (isLongCmd ? (!strcmp(s+2, longCmd) || !strcmp(s+2, "no-"longCmd)) : (tolower(s[1]) == shortCmd)) { \
- bool boolValue = (islower(s[1]) != 0); \
+ bool boolValue = (islower(static_cast<unsigned char>(s[1])) != 0); \
s += 2; \
if (isLongCmd) { \
boolValue = !strcmp(s, longCmd); \