From b694a78f62a02253bca2a5611314599ae7fce725 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Thu, 23 Jun 2011 05:42:48 -0400 Subject: 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 --- engines/sky/detection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/sky') diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp index f3cce06ad6..a1067496da 100644 --- a/engines/sky/detection.cpp +++ b/engines/sky/detection.cpp @@ -206,7 +206,7 @@ SaveStateList SkyMetaEngine::listSaves(const char *target) const { // Extract the extension Common::String ext = file->c_str() + file->size() - 3; ext.toUppercase(); - if (isdigit(ext[0]) && isdigit(ext[1]) && isdigit(ext[2])){ + if (isdigit(static_cast(ext[0])) && isdigit(static_cast(ext[1])) && isdigit(static_cast(ext[2]))){ int slotNum = atoi(ext.c_str()); Common::InSaveFile *in = saveFileMan->openForLoading(*file); if (in) { -- cgit v1.2.3