summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2017-10-06 18:39:13 (GMT)
committerAlexander Graf <agraf@suse.de>2017-10-09 05:00:36 (GMT)
commitc155dfeb1e17181998e66830b677baa8983daf6b (patch)
tree3896ef339d163592dfa5d63fa71d0de5b6510b75 /lib
parent5ca23ed5bc63832baa24a6107537fdd229c458ae (diff)
downloadu-boot-c155dfeb1e17181998e66830b677baa8983daf6b.tar.xz
efi_selftest: efi_st_memcmp return difference of bytes
If the memory regions are different efi_st_memcmp currently returns the difference of the addresses. Insted the difference of the first differing byte pair should be returned. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_selftest/efi_selftest_util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/efi_selftest/efi_selftest_util.c b/lib/efi_selftest/efi_selftest_util.c
index c9c295e..5cffe38 100644
--- a/lib/efi_selftest/efi_selftest_util.c
+++ b/lib/efi_selftest/efi_selftest_util.c
@@ -17,7 +17,7 @@ int efi_st_memcmp(const void *buf1, const void *buf2, size_t length)
for (; length; --length) {
if (*pos1 != *pos2)
- return pos1 - pos2;
+ return *pos1 - *pos2;
++pos1;
++pos2;
}