]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Fix bug in StrnCpy() and AsciStrnCpy(). It was copying Length - 1 characters instead...
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 25 Apr 2006 23:30:07 +0000 (23:30 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 25 Apr 2006 23:30:07 +0000 (23:30 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@34 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/BaseLib/String.c

index fb39a22a425203fade7ad03d2770b9a21054d057..86828e65fc2af52d4619c2d261311d2f2e242874 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
@@ -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