summaryrefslogtreecommitdiffstats
path: root/FatPkg/EnhancedFatDxe/FileName.c
diff options
context:
space:
mode:
authorDandan Bi <dandan.bi@intel.com>2016-12-08 13:10:29 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2016-12-09 11:02:06 +0800
commit5163b5f8d1907f4800a0600adeb53ff640952c00 (patch)
treece3d4d1a43b0f35cb5940350c871756dd04cf76b /FatPkg/EnhancedFatDxe/FileName.c
parentf42f22f5dd8b6421fe6780b06ed3fb327f9dd46b (diff)
downloadedk2-5163b5f8d1907f4800a0600adeb53ff640952c00.tar.gz
edk2-5163b5f8d1907f4800a0600adeb53ff640952c00.tar.bz2
edk2-5163b5f8d1907f4800a0600adeb53ff640952c00.zip
FatPkg/EnhancedFatDxe: Avoid Non-Boolean type uses as Boolean
Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Diffstat (limited to 'FatPkg/EnhancedFatDxe/FileName.c')
-rw-r--r--FatPkg/EnhancedFatDxe/FileName.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/FatPkg/EnhancedFatDxe/FileName.c b/FatPkg/EnhancedFatDxe/FileName.c
index 5df403625d..f393aa6357 100644
--- a/FatPkg/EnhancedFatDxe/FileName.c
+++ b/FatPkg/EnhancedFatDxe/FileName.c
@@ -59,7 +59,7 @@ Returns:
PossibleShortName = TRUE;
SeparateDot = NULL;
SetMem (File8Dot3Name, FAT_NAME_LEN, ' ');
- for (TempName = FileName; *TempName; TempName++) {
+ for (TempName = FileName; *TempName != '\0'; TempName++) {
if (*TempName == L'.') {
SeparateDot = TempName;
}
@@ -453,7 +453,7 @@ Returns:
UINT8 Sum;
Sum = 0;
for (ShortNameLen = FAT_NAME_LEN; ShortNameLen != 0; ShortNameLen--) {
- Sum = (UINT8)(((Sum & 1) ? 0x80 : 0) + (Sum >> 1) + *ShortNameString++);
+ Sum = (UINT8)((((Sum & 1) != 0) ? 0x80 : 0) + (Sum >> 1) + *ShortNameString++);
}
return Sum;