2013-05-14 15:11:29 +00:00
|
|
|
#include <stdlib.h>
|
1984-11-29 14:22:02 +00:00
|
|
|
|
2016-12-12 20:16:32 +00:00
|
|
|
char* salloc(unsigned length)
|
1984-11-29 14:22:02 +00:00
|
|
|
{
|
2016-12-12 20:16:32 +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
|
|
|
{
|
2016-12-12 20:16:32 +00:00
|
|
|
if (!c)
|
|
|
|
return;
|
1984-11-29 14:22:02 +00:00
|
|
|
free(c);
|
|
|
|
}
|