diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2017-03-18 02:58:55 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2017-03-18 02:58:55 +0000 |
commit | 4e33fed592ed2c59a6329379f67e62eddbc38ea0 (patch) | |
tree | f4a2bc82f1811b4811becc93dbdd2570bfdd0ba1 /usr.bin/at | |
parent | fe81165c8c77cc8c69800909f0073e8df2a6b563 (diff) |
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.c | 5 |
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; |