summaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
authorEric Andersen2000-07-28 15:14:45 +0000
committerEric Andersen2000-07-28 15:14:45 +0000
commit501c88b245fdc63f3f2a044fd7704bb468db3904 (patch)
tree3fff440532d8d380ae7e4f2933bc7163360f8279 /utility.c
parent6a99aaf0208151b7f5e5058efaa409496e2b7c4b (diff)
downloadbusybox-501c88b245fdc63f3f2a044fd7704bb468db3904.zip
busybox-501c88b245fdc63f3f2a044fd7704bb468db3904.tar.gz
More sh updates (with related changes to everything else). Switched
to using getopt and cleaned up the resulting mess. if-then-else-fi is now basically working (given a bunch of constraints). -Erik
Diffstat (limited to 'utility.c')
-rw-r--r--utility.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/utility.c b/utility.c
index 50f497f..565fd73 100644
--- a/utility.c
+++ b/utility.c
@@ -1465,13 +1465,21 @@ extern void *xmalloc(size_t size)
return ptr;
}
-void *xrealloc(void *old, size_t size)
+extern void *xrealloc(void *old, size_t size)
{
void *ptr = realloc(old, size);
if (!ptr)
fatalError(memory_exhausted);
return ptr;
}
+
+extern void *xcalloc(size_t nmemb, size_t size)
+{
+ void *ptr = calloc(nmemb, size);
+ if (!ptr)
+ fatalError(memory_exhausted);
+ return ptr;
+}
#endif
#if defined BB_FEATURE_NFSMOUNT