conterm/libc/mallocz.c

14 lines
141 B
C
Raw Normal View History

2005-08-08 16:50:13 +04:00
#include <u.h>
#include <libc.h>
void*
mallocz(ulong n, int clr)
{
void *v;
v = malloc(n);
if(v && clr)
memset(v, 0, n);
return v;
}