summaryrefslogtreecommitdiff
path: root/MdePkg/Library/UefiMemoryLib/MemLibGeneric.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/UefiMemoryLib/MemLibGeneric.c')
-rw-r--r--MdePkg/Library/UefiMemoryLib/MemLibGeneric.c8
1 files changed, 4 insertions, 4 deletions
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;