aboutsummaryrefslogtreecommitdiff
path: root/engines/m4/console.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/m4/console.cpp')
-rw-r--r--engines/m4/console.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/m4/console.cpp b/engines/m4/console.cpp
index 71c70e3e1b..3e7f9624cf 100644
--- a/engines/m4/console.cpp
+++ b/engines/m4/console.cpp
@@ -61,8 +61,10 @@ static int strToInt(const char *s) {
return atoi(s);
// Hexadecimal string
- uint tmp;
- sscanf(s, "%xh", &tmp);
+ uint tmp = 0;
+ int read = sscanf(s, "%xh", &tmp);
+ if (read < 1)
+ error("strToInt failed on string \"%s\"", s);
return (int)tmp;
}