zero.c 633 B

123456789101112131415161718192021222324252627282930
  1. /*!
  2. \file lib/db/dbmi_base/zero.c
  3. \brief DBMI Library (base) - zero
  4. (C) 1999-2009, 2011 by the GRASS Development Team
  5. This program is free software under the GNU General Public License
  6. (>=v2). Read the file COPYING that comes with GRASS for details.
  7. \author Joel Jones (CERL/UIUC), Radim Blazek, Brad Douglas, Markus Neteler
  8. \author Doxygenized by Martin Landa <landa.martin gmail.com> (2011)
  9. */
  10. #include <grass/dbmi.h>
  11. /*!
  12. \brief Zero allocated space
  13. \param s pointer to memory
  14. \param n number of bytes
  15. */
  16. void db_zero(void *s, int n)
  17. {
  18. char *c = (char *)s;
  19. while (n-- > 0)
  20. *c++ = 0;
  21. }