diff options
author | mmcc <mmcc@cvs.openbsd.org> | 2015-10-17 13:32:47 +0000 |
---|---|---|
committer | mmcc <mmcc@cvs.openbsd.org> | 2015-10-17 13:32:47 +0000 |
commit | 78a8d4779b8cbe6a4667b80f2deb004fc898101d (patch) | |
tree | 6bb5145cc2bc6402384567f73f235b4be447a2d4 /bin/ksh | |
parent | 064c6a353ddfd949a407209aacb6e3b6911266a8 (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.c | 6 |
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 * |