summaryrefslogtreecommitdiff
path: root/payloads/libpayload/libc
diff options
context:
space:
mode:
authorNico Huber <nico.huber@secunet.com>2015-08-19 17:22:26 +0200
committerNico Huber <nico.h@gmx.de>2015-08-19 16:35:08 +0000
commitf58746bd33f28bc7625e4fd6b166b6f977253c7d (patch)
tree016ce2519a8b4963501e12f7b2ec7a28fa5a68ff /payloads/libpayload/libc
parent7b928cd0c365f60bc9d60aa0da0aa2d8782bb5b1 (diff)
downloadcoreboot-f58746bd33f28bc7625e4fd6b166b6f977253c7d.tar.xz
libpayload: Fix default_memmove() implementation
If I wanted to fill the whole memory address space with one byte, I wouldn't try it that subtle. With size_t beeing unsigned the loop condition >= 0 was always true. Change-Id: Idee6a4901f6697093c88bda354b5e43066c0d948 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: http://review.coreboot.org/11286 Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins)
Diffstat (limited to 'payloads/libpayload/libc')
-rw-r--r--payloads/libpayload/libc/memory.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/payloads/libpayload/libc/memory.c b/payloads/libpayload/libc/memory.c
index 07a4d08a59..ae476cf196 100644
--- a/payloads/libpayload/libc/memory.c
+++ b/payloads/libpayload/libc/memory.c
@@ -78,7 +78,8 @@ void *memcpy(void *dst, const void *src, size_t n)
static void *default_memmove(void *dst, const void *src, size_t n)
{
- size_t i, offs;
+ size_t offs;
+ ssize_t i;
if (src > dst)
return memcpy(dst, src, n);