mirror of
https://github.com/openbsd/src.git
synced 2025-01-04 23:35:36 -08:00
reallocarray
This commit is contained in:
parent
542b517ffb
commit
c0bbadaa95
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: print.c,v 1.31 2014/01/09 03:07:52 guenther Exp $ */
|
||||
/* $OpenBSD: print.c,v 1.32 2014/05/06 20:55:10 tedu Exp $ */
|
||||
/* $NetBSD: print.c,v 1.15 1996/12/11 03:25:39 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
@ -174,7 +174,7 @@ printcol(DISPLAY *dp)
|
||||
if (dp->entries > lastentries) {
|
||||
FTSENT **a;
|
||||
|
||||
if ((a = realloc(array, dp->entries * sizeof(FTSENT *))) ==
|
||||
if ((a = reallocarray(array, dp->entries, sizeof(FTSENT *))) ==
|
||||
NULL) {
|
||||
free(array);
|
||||
array = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user