From 7a7f724a783da8a1eb3a93338e99a5f02d35f796 Mon Sep 17 00:00:00 2001 From: landley Date: Fri, 19 May 2006 20:36:49 +0000 Subject: A pending item in my tree I might as well check in: I plan to migrate calloc() and bb_calloc() calls to bb_xzalloc() which allocates prezeroed memory but only takes one argument (the size). git-svn-id: svn://busybox.net/trunk/busybox@15142 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- libbb/xfuncs.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libbb') diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c index fa6aa0f9f..d3c9e41e1 100644 --- a/libbb/xfuncs.c +++ b/libbb/xfuncs.c @@ -37,6 +37,15 @@ void *xrealloc(void *ptr, size_t size) } #endif +#ifdef L_xzalloc +void *xzalloc(size_t size) +{ + void *ptr = xmalloc(size); + memset(ptr, 0, size); + return ptr; +} +#endif + #ifdef L_xcalloc void *xcalloc(size_t nmemb, size_t size) { -- cgit v1.2.3-55-g6feb