ack/lang/basic/lib/salloc.c

21 lines
239 B
C
Raw Normal View History

#include <stdlib.h>
#include "lib.h"
1984-11-29 14:22:02 +00:00
char* salloc(unsigned length)
1984-11-29 14:22:02 +00:00
{
char* c, *s;
c = malloc(length);
if (!c)
error(5);
for (s = c; s < c + length; s++)
*s = 0;
return (c);
1984-11-29 14:22:02 +00:00
}
2016-12-12 20:15:25 +00:00
void sfree(char* c)
1984-11-29 14:22:02 +00:00
{
if (!c)
return;
1984-11-29 14:22:02 +00:00
free(c);
}