diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-10-08 05:35:28 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-10-08 05:35:28 +0000 |
commit | 55e3b6ff4e893dc2c5e3b7ee3e5ff567e0d3f107 (patch) | |
tree | 7a72414dc2036ff05635866f17fc4c1c8e54b377 /lib | |
parent | 17367dc993dad9a2e9b389448c890cd436c57844 (diff) |
obvious realloc -> reallocarray conversion
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/gen/glob.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/gen/glob.c b/lib/libc/gen/glob.c index c0b8e7813e9..da58261177e 100644 --- a/lib/libc/gen/glob.c +++ b/lib/libc/gen/glob.c @@ -1,4 +1,4 @@ -/* $OpenBSD: glob.c,v 1.40 2013/09/30 12:02:34 millert Exp $ */ +/* $OpenBSD: glob.c,v 1.41 2014/10/08 05:35:27 deraadt Exp $ */ /* * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. @@ -816,7 +816,7 @@ globextend(const Char *path, glob_t *pglob, struct glob_lim *limitp, return(GLOB_NOSPACE); } - pathv = realloc(pglob->gl_pathv, newn * sizeof(*pathv)); + pathv = reallocarray(pglob->gl_pathv, newn, sizeof(*pathv)); if (pathv == NULL) goto nospace; if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) { @@ -828,7 +828,7 @@ globextend(const Char *path, glob_t *pglob, struct glob_lim *limitp, pglob->gl_pathv = pathv; if ((pglob->gl_flags & GLOB_KEEPSTAT) != 0) { - statv = realloc(pglob->gl_statv, newn * sizeof(*statv)); + statv = reallocarray(pglob->gl_statv, newn, sizeof(*statv)); if (statv == NULL) goto nospace; if (pglob->gl_statv == NULL && pglob->gl_offs > 0) { |