projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
*** empty log message ***
[gnulib.git]
/
lib
/
memcpy.c
diff --git
a/lib/memcpy.c
b/lib/memcpy.c
index
b26d6a4
..
fdca8de
100644
(file)
--- a/
lib/memcpy.c
+++ b/
lib/memcpy.c
@@
-1,4
+1,4
@@
-/* Copyright (C) 1995, 1997 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
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,19
+20,19
@@
# include <config.h>
#endif
# 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. */
/* Copy LEN bytes starting at SRCADDR to DESTADDR. Result undefined
if the source overlaps with the destination.
Return DESTADDR. */
-char *
-memcpy (destaddr, srcaddr, len)
- char *destaddr;
- const char *srcaddr;
- int len;
+void *
+memcpy (void *destaddr, void const *srcaddr, size_t len)
{
char *dest = destaddr;
{
char *dest = destaddr;
+ char const *src = srcaddr;
while (len-- > 0)
while (len-- > 0)
- *dest
addr++ = *srcaddr
++;
- return dest;
+ *dest
++ = *src
++;
+ return dest
addr
;
}
}