]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/String.c
Added BuildTarget with enumerated data type (DEBUG|RELEASE|BOTH) to the PlatformHeade...
[mirror_edk2.git] / MdePkg / Library / BaseLib / String.c
index fb39a22a425203fade7ad03d2770b9a21054d057..6ef2c3b2d321688b0a643554dee68b19f1d56754 100644 (file)
@@ -116,7 +116,7 @@ StrnCpy (
 \r
   ReturnValue = Destination;\r
 \r
-  while ((*Source != L'\0') && (Length > 1)) {\r
+  while ((*Source != L'\0') && (Length > 0)) {\r
     *(Destination++) = *(Source++);\r
     Length--;\r
   }\r
@@ -277,7 +277,7 @@ StrnCmp (
   ASSERT (StrSize (SecondString) != 0);\r
 \r
   while ((*FirstString != L'\0') &&\r
-         (*FirstString != *SecondString) &&\r
+         (*FirstString == *SecondString) &&\r
          (Length > 1)) {\r
     FirstString++;\r
     SecondString++;\r
@@ -481,7 +481,7 @@ AsciiStrnCpy (
 \r
   ReturnValue = Destination;\r
 \r
-  while (*Source && Length > 1) {\r
+  while (*Source && Length > 0) {\r
     *(Destination++) = *(Source++);\r
     Length--;\r
   }\r
@@ -696,7 +696,7 @@ AsciiStrnCmp (
   ASSERT (AsciiStrSize (SecondString));\r
 \r
   while ((*FirstString != '\0') &&\r
-         (*FirstString != *SecondString) &&\r
+         (*FirstString == *SecondString) &&\r
          (Length > 1)) {\r
     FirstString++;\r
     SecondString++;\r