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
This commit is contained in:
@@ -116,7 +116,7 @@ StrnCpy (
|
|||||||
|
|
||||||
ReturnValue = Destination;
|
ReturnValue = Destination;
|
||||||
|
|
||||||
while ((*Source != L'\0') && (Length > 1)) {
|
while ((*Source != L'\0') && (Length > 0)) {
|
||||||
*(Destination++) = *(Source++);
|
*(Destination++) = *(Source++);
|
||||||
Length--;
|
Length--;
|
||||||
}
|
}
|
||||||
@@ -481,7 +481,7 @@ AsciiStrnCpy (
|
|||||||
|
|
||||||
ReturnValue = Destination;
|
ReturnValue = Destination;
|
||||||
|
|
||||||
while (*Source && Length > 1) {
|
while (*Source && Length > 0) {
|
||||||
*(Destination++) = *(Source++);
|
*(Destination++) = *(Source++);
|
||||||
Length--;
|
Length--;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user