X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fmemcpy.c;h=fdca8de2c80d99ec4017477507a1ed5ac6f75ea2;hb=2234a524956f7a24cd5d1396f0773d0583a5cca9;hp=2ccd71875924967640de05ea78fdb154a0a181a7;hpb=cada80c39eb8e6b19f36d6e02839b935b5dcab33;p=gnulib.git diff --git a/lib/memcpy.c b/lib/memcpy.c index 2ccd71875..fdca8de2c 100644 --- a/lib/memcpy.c +++ b/lib/memcpy.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 1997, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1997, 2000, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,16 +20,19 @@ # include #endif +#include + /* Copy LEN bytes starting at SRCADDR to DESTADDR. Result undefined if the source overlaps with the destination. Return DESTADDR. */ -char * -memcpy (char *destaddr, const char *srcaddr, int len) +void * +memcpy (void *destaddr, void const *srcaddr, size_t len) { char *dest = destaddr; + char const *src = srcaddr; while (len-- > 0) - *destaddr++ = *srcaddr++; - return dest; + *dest++ = *src++; + return destaddr; }