17 lines
237 B
C
17 lines
237 B
C
#include <stdlib.h>
|
|
#include <strings.h>
|
|
#include "util.h"
|
|
string String(char *s)
|
|
{
|
|
string p = checked_malloc(strlen(s)+1);
|
|
strcpy(p,s);
|
|
return p;
|
|
}
|
|
|
|
void *checked_malloc(int len)
|
|
{
|
|
void *p = malloc(len);
|
|
assert(p);
|
|
return p;
|
|
}
|