ack/lang/basic/lib/salloc.c
2018-06-24 00:35:51 +02:00

21 lines
239 B
C

#include <stdlib.h>
#include "lib.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);
}