2000-10-31 Philip Blundell <philb@gnu.org>
[binutils.git] / libiberty / memset.c
blob5f54831e83c468a62ecc2f59c90a50e8615a09f3
1 /* memset
2 This implementation is in the public domain. */
4 #include <ansidecl.h>
5 #ifdef __STDC__
6 #include <stddef.h>
7 #else
8 #define size_t unsigned long
9 #endif
11 PTR
12 DEFUN(memset, (dest, val, len),
13 PTR dest AND register int val AND register size_t len)
15 register unsigned char *ptr = (unsigned char*)dest;
16 while (len-- > 0)
17 *ptr++ = val;
18 return dest;