Author: stepan Date: 2008-08-19 21:18:58 +0200 (Tue, 19 Aug 2008) New Revision: 3527
Modified: trunk/payloads/libpayload/libc/memory.c Log: trivial fix for memcpy return code in case someone uses it.
Thanks to Ulf Jordan for figuring this out!
Signed-off-by: Stefan Reinauer stepan@coresystems.de Acked-by: Stefan Reinauer stepan@coresystems.de
Modified: trunk/payloads/libpayload/libc/memory.c =================================================================== --- trunk/payloads/libpayload/libc/memory.c 2008-08-19 17:59:34 UTC (rev 3526) +++ trunk/payloads/libpayload/libc/memory.c 2008-08-19 19:18:58 UTC (rev 3527) @@ -46,6 +46,7 @@ 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 @@ 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)