[edk2] [Patch] BaseTools: NULL pointer comparison to a char literal should be to NULL

Yonghong Zhu posted 1 patch 7 years, 2 months ago
Failed in applying to current master (apply log)
BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[edk2] [Patch] BaseTools: NULL pointer comparison to a char literal should be to NULL
Posted by Yonghong Zhu 7 years, 2 months ago
From: Nikolai SAOUKH <nms@otdel-1.org>

GCC7 complaint -- error: ISO C++ forbids comparison between pointer and
integer.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Nikolai SAOUKH <nms@otdel-1.org>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
---
 BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
index 3ca57ed..b81fc7b 100644
--- a/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
+++ b/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
@@ -3370,11 +3370,11 @@ CVfrStringDB::GetVarStoreNameFormStringId (
   EFI_STATUS  Status;
   CHAR8       LineBuf[EFI_IFR_MAX_LENGTH];
   UINT8       BlockType;
   EFI_HII_STRING_PACKAGE_HDR *PkgHeader;
   
-  if (mStringFileName == '\0' ) {
+  if (mStringFileName == NULL || *mStringFileName == '\0' ) {
     return NULL;
   }
 
   if ((pInFile = fopen (LongFilePath (mStringFileName), "rb")) == NULL) {
     return NULL;
-- 
2.6.1.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel