Skip to content

Commit

Permalink
NetworkPkg/HttpDxe: Fix build warning error if CHAR8 is unsigned.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Fu Siyuan <[email protected]>
Cc: Michael Kinney <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wu Jiaxin <[email protected]>
Reviewed-by: Fu Siyuan <[email protected]>
(cherry picked from commit 1e4725e)
  • Loading branch information
jiaxinwu committed Jan 10, 2018
1 parent e109866 commit 4276a38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions NetworkPkg/HttpDxe/HttpsSupport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4276a38

Please sign in to comment.