memset.c 499 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (C) 2002 Manuel Novoa III
  3. * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
  4. *
  5. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. */
  7. #include "_string.h"
  8. #ifdef WANT_WIDE
  9. # define Wmemset wmemset
  10. #else
  11. # undef memset
  12. # define Wmemset memset
  13. #endif
  14. Wvoid *Wmemset(Wvoid *s, Wint c, size_t n)
  15. {
  16. register Wuchar *p = (Wuchar *) s;
  17. while (n) {
  18. *p++ = (Wuchar) c;
  19. --n;
  20. }
  21. return s;
  22. }
  23. #ifndef WANT_WIDE
  24. libc_hidden_def(memset)
  25. #endif