aboutsummaryrefslogtreecommitdiff
path: root/engines/hugo
diff options
context:
space:
mode:
authorLittleboy2011-06-23 05:42:48 -0400
committerLittleboy2011-06-23 08:52:52 -0400
commitb694a78f62a02253bca2a5611314599ae7fce725 (patch)
tree115573b00e3b025ed334f9eadeadfb6161286089 /engines/hugo
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 'engines/hugo')
-rw-r--r--engines/hugo/parser.cpp2
-rw-r--r--engines/hugo/util.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp
index 5cb97f2dc5..38a8e4e3ff 100644
--- a/engines/hugo/parser.cpp
+++ b/engines/hugo/parser.cpp
@@ -235,7 +235,7 @@ void Parser::charHandler() {
if (_cmdLineIndex >= kMaxLineSize) {
//MessageBeep(MB_ICONASTERISK);
warning("STUB: MessageBeep() - Command line too long");
- } else if (isprint(c)) {
+ } else if (isprint(static_cast<unsigned char>(c))) {
_cmdLine[_cmdLineIndex++] = c;
_cmdLine[_cmdLineIndex] = '\0';
}
diff --git a/engines/hugo/util.cpp b/engines/hugo/util.cpp
index a936a23de1..6dc9890c3a 100644
--- a/engines/hugo/util.cpp
+++ b/engines/hugo/util.cpp
@@ -119,7 +119,7 @@ char *strlwr(char *buffer) {
char *result = buffer;
while (*buffer != '\0') {
- if (isupper(*buffer))
+ if (isupper(static_cast<unsigned char>(*buffer)))
*buffer = tolower(*buffer);
buffer++;
}