From 989c17810b9a8b3ac9fe848aa71d105875f025b9 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Tue, 19 Aug 2008 19:18:58 +0000 Subject: trivial fix for memcpy return code in case someone uses it. Thanks to Ulf Jordan for figuring this out! Signed-off-by: Stefan Reinauer Acked-by: Stefan Reinauer git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3527 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- payloads/libpayload/libc/memory.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'payloads/libpayload') diff --git a/payloads/libpayload/libc/memory.c b/payloads/libpayload/libc/memory.c index bf1f99b212..afc38cb263 100644 --- a/payloads/libpayload/libc/memory.c +++ b/payloads/libpayload/libc/memory.c @@ -46,6 +46,7 @@ void *memset(void *s, int c, size_t n) void *memcpy(void *dst, const void *src, size_t n) { int i; + void *ret = dst; for(i = 0; i < n % sizeof(unsigned long); i++) ((unsigned char *) dst)[i] = ((unsigned char *) src)[i]; @@ -57,7 +58,7 @@ void *memcpy(void *dst, const void *src, size_t n) for(i = 0; i < n / sizeof(unsigned long); i++) ((unsigned long *) dst)[i] = ((unsigned long *) src)[i]; - return dst; + return ret; } void *memmove(void *dst, const void *src, size_t n) -- cgit v1.2.3