From 1e4725e569960b1107c11df6c404312d26129eab Mon Sep 17 00:00:00 2001 From: Jiaxin Wu Date: Tue, 2 Jan 2018 11:29:03 +0800 Subject: [PATCH] NetworkPkg/HttpDxe: Fix build warning error if CHAR8 is unsigned. This patch is to fix the compiler warning error: C4245. The issue will happen if the below build option is enabled: *_*_*_CC_FLAGS = -J. That's because the value of ('A' - 'a') is a negative value, which will be converted to an unsigned type if CHAR8 is treated as unsigned: Src -= ('A' - 'a'); The above issue is also recorded at: https://bugzilla.tianocore.org/show_bug.cgi?id=815. Cc: Ye Ting Cc: Fu Siyuan Cc: Michael Kinney Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin Reviewed-by: Fu Siyuan --- NetworkPkg/HttpDxe/HttpsSupport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NetworkPkg/HttpDxe/HttpsSupport.c b/NetworkPkg/HttpDxe/HttpsSupport.c index e6f4d5a6cc..6aed61a3a4 100644 --- a/NetworkPkg/HttpDxe/HttpsSupport.c +++ b/NetworkPkg/HttpDxe/HttpsSupport.c @@ -67,11 +67,11 @@ AsciiStrCaseStr ( Dst = *SearchStringTmp; if ((Src >= 'A') && (Src <= 'Z')) { - Src -= ('A' - 'a'); + Src += ('a' - 'A'); } if ((Dst >= 'A') && (Dst <= 'Z')) { - Dst -= ('A' - 'a'); + Dst += ('a' - 'A'); } if (Src != Dst) {