From c2e08538ee87e156720e6adc5da0bdb090df6a39 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 15 Oct 2010 15:05:23 +0000 Subject: M4: Fixed code analysis warnings - bug #3087845 svn-id: r53500 --- engines/m4/console.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'engines/m4/console.cpp') 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; } -- cgit v1.2.3