summaryrefslogtreecommitdiff
path: root/usr.bin/find/main.c
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2014-05-18 08:10:01 +0000
committerMarc Espie <espie@cvs.openbsd.org>2014-05-18 08:10:01 +0000
commitca2bb4374aeb6d129f5f9e94e69dbad382f7792c (patch)
treef7d9d40c0d466b826aaf7953ba0e9a3e22cbe006 /usr.bin/find/main.c
parentbf73e6ad642681c23ce61a4a312483138e3811e2 (diff)
use reallocarray
okay chl@, tedu@
Diffstat (limited to 'usr.bin/find/main.c')
-rw-r--r--usr.bin/find/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/find/main.c b/usr.bin/find/main.c
index 2a0b28f479e..e40b345c2b7 100644
--- a/usr.bin/find/main.c
+++ b/usr.bin/find/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.29 2013/11/15 22:20:04 millert Exp $ */
+/* $OpenBSD: main.c,v 1.30 2014/05/18 08:10:00 espie Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -67,7 +67,7 @@ main(int argc, char *argv[])
(void)time(&now); /* initialize the time-of-day */
- p = paths = (char **) emalloc(sizeof(char *) * argc);
+ p = paths = ereallocarray(NULL, argc, sizeof(char *));
sigaction(SIGINFO, &sa, NULL);
@@ -121,7 +121,7 @@ main(int argc, char *argv[])
usage();
*p = NULL;
- if (!(paths2 = realloc(paths, sizeof(char *) * (p - paths + 1))))
+ if (!(paths2 = reallocarray(paths, p - paths + 1, sizeof(char *))))
err(1, NULL);
paths = paths2;