diff options
author | Jim Meyering <jim@meyering.net> | 2003-09-10 09:03:31 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-09-10 09:03:31 +0000 |
commit | d10831f97b4ecadcdb415536259877c4c65e8325 (patch) | |
tree | 2b620fc71eb9dc0ae225a61951c1cd85e1da24cf /lib/memcpy.c | |
parent | e0a2e262a57064c6f0d627aa4c5e1d1500d5f2e8 (diff) | |
download | coreutils-d10831f97b4ecadcdb415536259877c4c65e8325.tar.xz |
Include <stddef.h>.
Use types required by C89 in prototype.
Diffstat (limited to 'lib/memcpy.c')
-rw-r--r-- | lib/memcpy.c | 13 |
1 files changed, 8 insertions, 5 deletions
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 <config.h> #endif +#include <stddef.h> + /* 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; } |