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 --- base/commandLine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'base') diff --git a/base/commandLine.cpp b/base/commandLine.cpp index 6cb858525e..2620d69ba2 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -279,7 +279,7 @@ void registerDefaults() { // resp. between "--some-option" and "--no-some-option". #define DO_OPTION_BOOL(shortCmd, longCmd) \ if (isLongCmd ? (!strcmp(s+2, longCmd) || !strcmp(s+2, "no-"longCmd)) : (tolower(s[1]) == shortCmd)) { \ - bool boolValue = (islower(s[1]) != 0); \ + bool boolValue = (islower(static_cast(s[1])) != 0); \ s += 2; \ if (isLongCmd) { \ boolValue = !strcmp(s, longCmd); \ -- cgit v1.2.3