aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-05-19 20:36:49 +0000
committerlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-05-19 20:36:49 +0000
commit7a7f724a783da8a1eb3a93338e99a5f02d35f796 (patch)
tree0595f3f0671af4a40d5ee87c18bcf4dc4def3a41 /libbb
parentc1cd81cf26a3aad969743b158b660cd6279daa60 (diff)
downloadbusybox-w32-7a7f724a783da8a1eb3a93338e99a5f02d35f796.tar.gz
busybox-w32-7a7f724a783da8a1eb3a93338e99a5f02d35f796.tar.bz2
busybox-w32-7a7f724a783da8a1eb3a93338e99a5f02d35f796.zip
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
Diffstat (limited to 'libbb')
-rw-r--r--libbb/xfuncs.c9
1 files changed, 9 insertions, 0 deletions
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)
37} 37}
38#endif 38#endif
39 39
40#ifdef L_xzalloc
41void *xzalloc(size_t size)
42{
43 void *ptr = xmalloc(size);
44 memset(ptr, 0, size);
45 return ptr;
46}
47#endif
48
40#ifdef L_xcalloc 49#ifdef L_xcalloc
41void *xcalloc(size_t nmemb, size_t size) 50void *xcalloc(size_t nmemb, size_t size)
42{ 51{