ack/lang/basic/lib/salloc.c
keie c2e988c3d5 1 - Changed argument from int to unsigned.
2 - The test for a failed malloc is changed from comparison to -1
    to comparison to 0.
1985-01-21 23:54:46 +00:00

21 lines
234 B
C

/* $Header$ */
extern char *malloc() ;
char * salloc(length)
unsigned length;
{
char *c, *s;
c= malloc(length);
if( !c ) error(5);
for(s=c;s<c+length;s++) *s = 0;
return(c);
}
sfree(c)
char *c;
{
if( !c ) return;
free(c);
}