aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/dc/mem.c
diff options
context:
space:
mode:
authorPedro F. Giffuni <pfg@FreeBSD.org>2017-03-05 16:10:35 +0000
committerPedro F. Giffuni <pfg@FreeBSD.org>2017-03-05 16:10:35 +0000
commit63433bc937051f84486b603e9803597db68f796b (patch)
tree3b85912a1a98333288adba4e1610a49447f3a2f2 /usr.bin/dc/mem.c
parentd457839bc81ca7d922661f349b8b9a0e3fe13238 (diff)
downloadsrc-63433bc937051f84486b603e9803597db68f796b.tar.gz
src-63433bc937051f84486b603e9803597db68f796b.zip
bc/dc/patch: make some use of reallocarray(3).
reallocarray(3) is a non portable extension from OpenBSD. Given that it is already in FreeBSD, make easier future merges by adopting in some cases where the code has some shared heritage with OpenBSD. Obtained from: OpenBSD
Notes
Notes: svn path=/head/; revision=314704
Diffstat (limited to 'usr.bin/dc/mem.c')
-rw-r--r--usr.bin/dc/mem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/dc/mem.c b/usr.bin/dc/mem.c
index 78fb429e2604..e83a70ad5ec8 100644
--- a/usr.bin/dc/mem.c
+++ b/usr.bin/dc/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.5 2009/10/27 23:59:37 deraadt Exp $ */
+/* $OpenBSD: mem.c,v 1.6 2014/12/01 13:13:00 deraadt Exp $ */
/*
* Copyright (c) 2003, Otto Moerbeek <otto@drijf.net>
@@ -72,11 +72,11 @@ bmalloc(size_t sz)
}
void *
-brealloc(void *p, size_t sz)
+breallocarray(void *p, size_t nmemb, size_t size)
{
void *q;
- q = realloc(p, sz);
+ q = reallocarray(p, nmemb, size);
if (q == NULL)
err(1, NULL);
return (q);