home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Utilities / Winter Shell 1.0d2 / Source / Libraries / memclr.c < prev   
Encoding:
Text File  |  1994-01-09  |  312 b   |  16 lines  |  [TEXT/KAHL]

  1. /* fill the n bytes following p with nulls, return p */
  2. void *memclr(void *p, register unsigned long n)
  3. {
  4.     register long *l;
  5.     register char *s;
  6.     register unsigned long m;
  7.     
  8.     l = p;
  9.     m = n / sizeof(long);
  10.     while (m-- > 0) *l++ = 0;
  11.     s = (char *) l;
  12.     n = n % sizeof(long);
  13.     while (n-- > 0) *s++ = 0;
  14.     return(p);
  15. }
  16.