From: Xu, Wei6 Date: Tue, 13 Aug 2019 10:53:49 +0000 (+0800) Subject: MdeModulePkg/DxeCapsuleLibFmp: Improve comparisons in CapsuleOnDisk.c X-Git-Tag: edk2-stable201908~93 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=f5892aa8d8bfbe8e6af5c9765faad8cfe877c334 MdeModulePkg/DxeCapsuleLibFmp: Improve comparisons in CapsuleOnDisk.c BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2028 Non-Boolean comparisons should use a compare operator (==, !=, >, < >=, <=). Signed-off-by: Wei6 Xu Reviewed-by: Liming Gao Reviewed-by: Hao A Wu --- diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c index 3193ca8f4d..4c32c6cdcf 100644 --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/CapsuleOnDisk.c @@ -127,7 +127,7 @@ UpperCaseString ( { CHAR16 *Cptr; - for (Cptr = Str; *Cptr; Cptr++) { + for (Cptr = Str; *Cptr != L'\0'; Cptr++) { if (L'a' <= *Cptr && *Cptr <= L'z') { *Cptr = *Cptr - L'a' + L'A'; }