summaryrefslogtreecommitdiff
path: root/bin/ksh
diff options
context:
space:
mode:
authormmcc <mmcc@cvs.openbsd.org>2015-10-17 13:32:47 +0000
committermmcc <mmcc@cvs.openbsd.org>2015-10-17 13:32:47 +0000
commit78a8d4779b8cbe6a4667b80f2deb004fc898101d (patch)
tree6bb5145cc2bc6402384567f73f235b4be447a2d4 /bin/ksh
parent064c6a353ddfd949a407209aacb6e3b6911266a8 (diff)
Change allocarray() to areallocarray(), a full reallocarray clone. All
the logic is already in aresize(). "Sure" nicm@
Diffstat (limited to 'bin/ksh')
-rw-r--r--bin/ksh/alloc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/ksh/alloc.c b/bin/ksh/alloc.c
index 841b5afe2cf..e6eee0e0ff8 100644
--- a/bin/ksh/alloc.c
+++ b/bin/ksh/alloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: alloc.c,v 1.11 2015/10/17 13:27:55 mmcc Exp $ */
+/* $OpenBSD: alloc.c,v 1.12 2015/10/17 13:32:46 mmcc Exp $ */
/*
* Copyright (c) 2002 Marc Espie.
*
@@ -88,7 +88,7 @@ alloc(size_t size, Area *ap)
#define MUL_NO_OVERFLOW (1UL << (sizeof(size_t) * 4))
void *
-allocarray(size_t nmemb, size_t size, Area *ap)
+areallocarray(void *ptr, size_t nmemb, size_t size, Area *ap)
{
/* condition logic cloned from calloc() */
if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) &&
@@ -96,7 +96,7 @@ allocarray(size_t nmemb, size_t size, Area *ap)
internal_errorf(1, "unable to allocate memory");
}
- return alloc(nmemb * size, ap);
+ return aresize(ptr, nmemb * size, ap);
}
void *