diff --git a/EdkModulePkg/Core/Pei/Image/Image.c b/EdkModulePkg/Core/Pei/Image/Image.c index 6a26bb2ab4..377a0d918d 100644 --- a/EdkModulePkg/Core/Pei/Image/Image.c +++ b/EdkModulePkg/Core/Pei/Image/Image.c @@ -227,7 +227,7 @@ Returns: } if (AsciiString != NULL) { FileNameFound = FALSE; - for (Index = 0, Index1 = 0; (AsciiString[Index] != 0) && (Index < sizeof (AsciiString)); Index++) { + for (Index = 0, Index1 = 0; AsciiString[Index] != '\0'; Index++) { if (AsciiString[Index] == '\\') { Index1 = Index; FileNameFound = TRUE;