home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / sqdev200.zip / samples / smalloc.c < prev    next >
C/C++ Source or Header  |  1994-05-23  |  340b  |  26 lines

  1. #include <stdlib.h>
  2. #include <string.h>
  3. #include "prog.h"
  4.  
  5. void * _fast smalloc(unsigned size)
  6. {
  7.   void *mem;
  8.   
  9.   if ((mem=(void *)malloc(size))==NULL)
  10.     NoMem();
  11.  
  12.   memset(mem, '\0', size);
  13.   return mem;
  14. }
  15.  
  16.  
  17. char * _fast sstrdup(char *s)
  18. {
  19.   char *p;
  20.   
  21.   if ((p=strdup(s))==NULL)
  22.     NoMem();
  23.   
  24.   return p;
  25. }
  26.