summaryrefslogtreecommitdiff
path: root/usr.bin/xargs
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2018-06-12 15:24:32 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2018-06-12 15:24:32 +0000
commit9349f6fb02680429072e2c241cfaca107b54be08 (patch)
tree34875742c23ada54322a07c5f202d63bd725c901 /usr.bin/xargs
parentd76226ccd710945dd576b860687baae17749f4ef (diff)
Use sizeof(char *) not sizeof(char **) when allocating an array
of strings with calloc(3). From David CARLIER. OK tb@
Diffstat (limited to 'usr.bin/xargs')
-rw-r--r--usr.bin/xargs/xargs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c
index 0ab4d16a739..ce1533e7016 100644
--- a/usr.bin/xargs/xargs.c
+++ b/usr.bin/xargs/xargs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xargs.c,v 1.33 2017/10/16 13:10:50 anton Exp $ */
+/* $OpenBSD: xargs.c,v 1.34 2018/06/12 15:24:31 millert Exp $ */
/* $FreeBSD: xargs.c,v 1.51 2003/05/03 19:09:11 obrien Exp $ */
/*-
@@ -198,7 +198,7 @@ main(int argc, char *argv[])
* NULL.
*/
linelen = 1 + argc + nargs + 1;
- if ((av = bxp = calloc(linelen, sizeof(char **))) == NULL)
+ if ((av = bxp = calloc(linelen, sizeof(char *))) == NULL)
err(1, NULL);
/*
@@ -438,7 +438,7 @@ prerun(int argc, char *argv[])
* Allocate memory to hold the argument list, and
* a NULL at the tail.
*/
- tmp = calloc(argc + 1, sizeof(char**));
+ tmp = calloc(argc + 1, sizeof(char *));
if (tmp == NULL)
err(1, NULL);
tmp2 = tmp;