bzero.c 396 B

123456789101112131415161718192021222324
  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 __UCLIBC_SUSV3_LEGACY__
  9. void bzero(void *s, size_t n)
  10. {
  11. #if 1
  12. (void)memset(s, 0, n);
  13. #else
  14. register unsigned char *p = s;
  15. while (n) {
  16. *p++ = 0;
  17. --n;
  18. }
  19. #endif
  20. }
  21. #endif