home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 9 / FreshFishVol9-CD2.bin / bbs / gnu / libnix-0.8-src.lha / libnix-0.8 / sources / nix / misc / bzero.c < prev   
Encoding:
C/C++ Source or Header  |  1994-12-12  |  246 b   |  16 lines

  1. #include <string.h>
  2.  
  3. void bzero(void *b,size_t len)
  4. { size_t n;
  5.   if((unsigned long)b&1)
  6.   { *((char *)b)++=0;
  7.     len--; }
  8.   n=len/sizeof(long);
  9.   len-=n*sizeof(long);
  10.   while(n--)
  11.     *((long *)b)++=0;
  12.   while(len--)
  13.     *((char *)b)++=0;
  14. }
  15.   
  16.