summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseLib/String.c
diff options
context:
space:
mode:
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2006-04-25 23:30:07 +0000
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2006-04-25 23:30:07 +0000
commit6cfb0c24a8c22b1379f72f089334112b3d271f9a (patch)
tree210e9c5d069968acb1e63890d86cbafefbc6df3e /MdePkg/Library/BaseLib/String.c
parent27f019223ce264f77c6db57a38018c46c6cb7a04 (diff)
downloadedk2-platforms-6cfb0c24a8c22b1379f72f089334112b3d271f9a.tar.xz
Fix bug in StrnCpy() and AsciStrnCpy(). It was copying Length - 1 characters instead of Length characters.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@34 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BaseLib/String.c')
-rw-r--r--MdePkg/Library/BaseLib/String.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/MdePkg/Library/BaseLib/String.c b/MdePkg/Library/BaseLib/String.c
index fb39a22a42..86828e65fc 100644
--- a/MdePkg/Library/BaseLib/String.c
+++ b/MdePkg/Library/BaseLib/String.c
@@ -116,7 +116,7 @@ StrnCpy (
ReturnValue = Destination;
- while ((*Source != L'\0') && (Length > 1)) {
+ while ((*Source != L'\0') && (Length > 0)) {
*(Destination++) = *(Source++);
Length--;
}
@@ -481,7 +481,7 @@ AsciiStrnCpy (
ReturnValue = Destination;
- while (*Source && Length > 1) {
+ while (*Source && Length > 0) {
*(Destination++) = *(Source++);
Length--;
}