summaryrefslogtreecommitdiffstats
path: root/usr.bin/at
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2017-03-18 02:58:54 +0000
committerderaadt <deraadt@openbsd.org>2017-03-18 02:58:54 +0000
commit368190f3ede052d95e06e051c2b2bd8c8d94cb25 (patch)
treea9e65dcafb386e44079e1ab1524313e9db1091c3 /usr.bin/at
parentThe "ioctl" pledge which was had functionality split out into "tape", (diff)
downloadwireguard-openbsd-368190f3ede052d95e06e051c2b2bd8c8d94cb25.tar.xz
wireguard-openbsd-368190f3ede052d95e06e051c2b2bd8c8d94cb25.zip
Use recallocarray for growth of the jobs, just because it is a little
beefier than pointers.
Diffstat (limited to 'usr.bin/at')
-rw-r--r--usr.bin/at/at.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/at/at.c b/usr.bin/at/at.c
index 1781f01c24c..7a9c63ddc17 100644
--- a/usr.bin/at/at.c
+++ b/usr.bin/at/at.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: at.c,v 1.78 2016/10/31 17:22:07 schwarze Exp $ */
+/* $OpenBSD: at.c,v 1.79 2017/03/18 02:58:54 deraadt Exp $ */
/*
* at.c : Put file into atrun queue
@@ -557,7 +557,8 @@ list_jobs(int argc, char **argv, int count_only, int csort)
job->queue = queue;
if (numjobs == maxjobs) {
size_t newjobs = maxjobs * 2;
- newatjobs = reallocarray(atjobs, newjobs, sizeof(job));
+ newatjobs = recallocarray(atjobs, maxjobs,
+ newjobs, sizeof(job));
if (newatjobs == NULL)
fatal(NULL);
atjobs = newatjobs;