memset.c 355 B

123456789101112131415161718192021
  1. /*
  2. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  3. * See the copyright notice in the ACK home directory, in the file "Copyright".
  4. */
  5. /* $Id$ */
  6. #include <string.h>
  7. void *
  8. memset(void *s, register int c, register size_t n)
  9. {
  10. register char *s1 = s;
  11. if (n>0) {
  12. n++;
  13. while (--n > 0) {
  14. *s1++ = c;
  15. }
  16. }
  17. return s;
  18. }