nuke_str.c 358 B

1234567891011121314151617181920
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * Utility routines.
  4. *
  5. * Copyright (C) 2008 Denys Vlasenko
  6. *
  7. * Licensed under GPLv2, see file LICENSE in this source tree.
  8. */
  9. //kbuild:lib-y += nuke_str.o
  10. #include "libbb.h"
  11. void FAST_FUNC nuke_str(char *str)
  12. {
  13. if (str) {
  14. while (*str)
  15. *str++ = 0;
  16. /* or: memset(str, 0, strlen(str)); - not as small as above */
  17. }
  18. }