In AsciiStrncmp(), if length=0, should return 0
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 8 Jul 2006 15:21:04 +0000 (15:21 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Sat, 8 Jul 2006 15:21:04 +0000 (15:21 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@840 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/BaseLib/String.c

index 80223c6..a59a9d0 100644 (file)
@@ -713,6 +713,10 @@ AsciiStrnCmp (
   IN      UINTN                     Length\r
   )\r
 {\r
+  if (Length == 0) {\r
+    return 0;\r
+  }\r
+\r
   //\r
   // ASSERT both strings are less long than PcdMaximumAsciiStringLength\r
   //\r