summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2010-08-26 00:50:37 +0000
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>2010-08-26 00:50:37 +0000
commit00dbccf2d5121545a89d88b04b408ebbb75aad0f (patch)
treedb0d75030d7538f206eda1c8fb9eb0c95468b270
parentffadc63799c2f95dffd081fe911bcbbce37e53ec (diff)
downloadedk2-platforms-00dbccf2d5121545a89d88b04b408ebbb75aad0f.tar.xz
Sync bug fix in Edk r10821 to PeiMemoryLib and UefiMemoryLib instances.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10822 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdePkg/Library/PeiMemoryLib/MemLibGeneric.c8
-rw-r--r--MdePkg/Library/UefiMemoryLib/MemLibGeneric.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/MdePkg/Library/PeiMemoryLib/MemLibGeneric.c b/MdePkg/Library/PeiMemoryLib/MemLibGeneric.c
index db56b503d5..53f1cafa42 100644
--- a/MdePkg/Library/PeiMemoryLib/MemLibGeneric.c
+++ b/MdePkg/Library/PeiMemoryLib/MemLibGeneric.c
@@ -163,7 +163,7 @@ InternalMemScanMem8 (
Pointer = (CONST UINT8*)Buffer;
do {
if (*(Pointer++) == Value) {
- return Pointer;
+ return --Pointer;
}
} while (--Length != 0);
return NULL;
@@ -193,7 +193,7 @@ InternalMemScanMem16 (
Pointer = (CONST UINT16*)Buffer;
do {
if (*(Pointer++) == Value) {
- return Pointer;
+ return --Pointer;
}
} while (--Length != 0);
return NULL;
@@ -223,7 +223,7 @@ InternalMemScanMem32 (
Pointer = (CONST UINT32*)Buffer;
do {
if (*(Pointer++) == Value) {
- return Pointer;
+ return --Pointer;
}
} while (--Length != 0);
return NULL;
@@ -253,7 +253,7 @@ InternalMemScanMem64 (
Pointer = (CONST UINT64*)Buffer;
do {
if (*(Pointer++) == Value) {
- return Pointer;
+ return --Pointer;
}
} while (--Length != 0);
return NULL;
diff --git a/MdePkg/Library/UefiMemoryLib/MemLibGeneric.c b/MdePkg/Library/UefiMemoryLib/MemLibGeneric.c
index 2780cbfd9b..1ec8bf6bad 100644
--- a/MdePkg/Library/UefiMemoryLib/MemLibGeneric.c
+++ b/MdePkg/Library/UefiMemoryLib/MemLibGeneric.c
@@ -163,7 +163,7 @@ InternalMemScanMem8 (
Pointer = (CONST UINT8*)Buffer;
do {
if (*(Pointer++) == Value) {
- return Pointer;
+ return --Pointer;
}
} while (--Length != 0);
return NULL;
@@ -193,7 +193,7 @@ InternalMemScanMem16 (
Pointer = (CONST UINT16*)Buffer;
do {
if (*(Pointer++) == Value) {
- return Pointer;
+ return --Pointer;
}
} while (--Length != 0);
return NULL;
@@ -223,7 +223,7 @@ InternalMemScanMem32 (
Pointer = (CONST UINT32*)Buffer;
do {
if (*(Pointer++) == Value) {
- return Pointer;
+ return --Pointer;
}
} while (--Length != 0);
return NULL;
@@ -253,7 +253,7 @@ InternalMemScanMem64 (
Pointer = (CONST UINT64*)Buffer;
do {
if (*(Pointer++) == Value) {
- return Pointer;
+ return --Pointer;
}
} while (--Length != 0);
return NULL;