plan9port/src/cmd/secstore/util.c

29 lines
349 B
C
Raw Normal View History

2004-12-27 19:36:51 +00:00
#include <u.h>
#include <libc.h>
void *
emalloc(ulong n)
{
void *p = malloc(n);
if(p == nil)
sysfatal("emalloc");
memset(p, 0, n);
return p;
}
void *
erealloc(void *p, ulong n)
{
if ((p = realloc(p, n)) == nil)
sysfatal("erealloc");
return p;
}
char *
estrdup(char *s)
{
if ((s = strdup(s)) == nil)
sysfatal("estrdup");
return s;
}