home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
-
- extern char *malloc();
-
- /*
- * smalloc
- *
- * allocates memory - checking for null
- */
- char *
- smalloc(size)
- unsigned size;
- {
- char *p, *p2, buf[BUFSIZ];
-
- if ((p = malloc(size)) == (char *)NULL) {
- sprintf(buf, "smalloc: request for %d bytes from malloc returns NULL.\n", size);
- fatal(buf);
- }
-
- /*
- for (p2 = p; p2 != p + size; p2++)
- *p2 = 0xff;
- */
-
- return(p);
- }
-
-