Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/spell/spellprog spell(1): convert realloc(x * y) to ...
details: https://anonhg.NetBSD.org/src/rev/629d83bd3c5c
branches: trunk
changeset: 1025502:629d83bd3c5c
user: nia <nia%NetBSD.org@localhost>
date: Tue Nov 09 09:41:05 2021 +0000
description:
spell(1): convert realloc(x * y) to reallocarr
diffstat:
usr.bin/spell/spellprog/spellprog.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diffs (21 lines):
diff -r 1b6adf8502f2 -r 629d83bd3c5c usr.bin/spell/spellprog/spellprog.c
--- a/usr.bin/spell/spellprog/spellprog.c Tue Nov 09 09:21:31 2021 +0000
+++ b/usr.bin/spell/spellprog/spellprog.c Tue Nov 09 09:41:05 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spellprog.c,v 1.9 2013/11/18 19:55:59 joerg Exp $ */
+/* $NetBSD: spellprog.c,v 1.10 2021/11/09 09:41:05 nia Exp $ */
/* derived from OpenBSD: spellprog.c,v 1.4 2003/06/03 02:56:16 millert Exp */
@@ -864,10 +864,8 @@
getderiv(size_t lev)
{
if (deriv.maxlev < lev) {
- void *p = realloc(deriv.buf, sizeof(*deriv.buf) * lev);
- if (p == NULL)
+ if (reallocarr(&deriv.buf, lev, sizeof(*deriv.buf)) != 0)
err(1, "Cannot grow array");
- deriv.buf = p;
deriv.maxlev = lev;
}
}
Home |
Main Index |
Thread Index |
Old Index