ack/lang/basic/lib/salloc.c
2016-12-12 21:16:32 +01:00

20 lines
222 B
C

#include <stdlib.h>
char* salloc(unsigned length)
{
char* c, *s;
c = malloc(length);
if (!c)
error(5);
for (s = c; s < c + length; s++)
*s = 0;
return (c);
}
void sfree(char* c)
{
if (!c)
return;
free(c);
}