home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / text / hyper / ADtoHT2_0.lha / MyLib.lha / string / memset.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-14  |  390 b   |  34 lines

  1. #include <string.h>
  2.  
  3. /************************************************************************/
  4.  
  5. #undef memset
  6.  
  7. #if defined(__SASC_510)
  8.  
  9. void *memset(void *s, int c, size_t n)
  10.  
  11. {
  12.   return __builtin_memset(s,c,n);
  13. }
  14.  
  15. #else
  16.  
  17. void *memset(void *s, int c, size_t n)
  18.  
  19.   if (n != 0)
  20.     {
  21.       unsigned char *p=s;
  22.  
  23.       do
  24.     {
  25.       *p++=c;
  26.     }
  27.       while(--n != 0);
  28.     }
  29.   return s;
  30. }
  31.  
  32. #endif
  33.