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/sword25/util/lua/llex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/sword25') diff --git a/engines/sword25/util/lua/llex.cpp b/engines/sword25/util/lua/llex.cpp index 4d73a6a600..b456ee2dfe 100644 --- a/engines/sword25/util/lua/llex.cpp +++ b/engines/sword25/util/lua/llex.cpp @@ -188,7 +188,7 @@ static void trydecpoint (LexState *ls, SemInfo *seminfo) { sprintf(buf, "%.1f", 1.0); ls->decpoint = '.'; for (i = 0; buf[i]; i++) { - if (!isspace(buf[i]) && !isdigit(buf[i])) { + if (!isspace(static_cast(buf[i])) && !isdigit(static_cast(buf[i]))) { ls->decpoint = buf[i]; break; } -- cgit v1.2.3