diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2014-05-18 08:10:01 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2014-05-18 08:10:01 +0000 |
commit | ca2bb4374aeb6d129f5f9e94e69dbad382f7792c (patch) | |
tree | f7d9d40c0d466b826aaf7953ba0e9a3e22cbe006 /usr.bin/find/misc.c | |
parent | bf73e6ad642681c23ce61a4a312483138e3811e2 (diff) |
use reallocarray
okay chl@, tedu@
Diffstat (limited to 'usr.bin/find/misc.c')
-rw-r--r-- | usr.bin/find/misc.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/usr.bin/find/misc.c b/usr.bin/find/misc.c index 95bec3833b3..37e61a9aea0 100644 --- a/usr.bin/find/misc.c +++ b/usr.bin/find/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.11 2009/10/27 23:59:38 deraadt Exp $ */ +/* $OpenBSD: misc.c,v 1.12 2014/05/18 08:10:00 espie Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -115,7 +115,7 @@ queryuser(char **argv) * malloc with error checking. */ void * -emalloc(u_int len) +emalloc(size_t len) { void *p; @@ -124,6 +124,16 @@ emalloc(u_int len) err(1, NULL); } +void * +ereallocarray(void *oldp, size_t sz1, size_t sz2) +{ + void *p; + + if ((p = reallocarray(oldp, sz1, sz2)) != NULL) + return (p); + err(1, NULL); +} + /* * show_path -- * called on SIGINFO |