summaryrefslogtreecommitdiff
path: root/usr.bin/diff3/diff3prog.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2014-12-01 06:36:33 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2014-12-01 06:36:33 +0000
commit6891c5cd8be7a81a5c46de109e4f35f246b9c6fc (patch)
tree4e783215634f8e433a740cd0d6c10d2020fc11c5 /usr.bin/diff3/diff3prog.c
parentd64ce1902e872b6a2e9d67fc497577d94f69efe3 (diff)
trivial reallocarray() use
Diffstat (limited to 'usr.bin/diff3/diff3prog.c')
-rw-r--r--usr.bin/diff3/diff3prog.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/diff3/diff3prog.c b/usr.bin/diff3/diff3prog.c
index 35c532c2e9f..94d5410dfe1 100644
--- a/usr.bin/diff3/diff3prog.c
+++ b/usr.bin/diff3/diff3prog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff3prog.c,v 1.13 2013/11/15 22:20:04 millert Exp $ */
+/* $OpenBSD: diff3prog.c,v 1.14 2014/12/01 06:36:32 deraadt Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
@@ -573,22 +573,22 @@ increase(void)
newsz = szchanges == 0 ? 64 : 2 * szchanges;
incr = newsz - szchanges;
- p = realloc(d13, newsz * sizeof(struct diff));
+ p = reallocarray(d13, newsz, sizeof(struct diff));
if (p == NULL)
err(1, NULL);
memset(p + szchanges, 0, incr * sizeof(struct diff));
d13 = p;
- p = realloc(d23, newsz * sizeof(struct diff));
+ p = reallocarray(d23, newsz, sizeof(struct diff));
if (p == NULL)
err(1, NULL);
memset(p + szchanges, 0, incr * sizeof(struct diff));
d23 = p;
- p = realloc(de, newsz * sizeof(struct diff));
+ p = reallocarray(de, newsz, sizeof(struct diff));
if (p == NULL)
err(1, NULL);
memset(p + szchanges, 0, incr * sizeof(struct diff));
de = p;
- q = realloc(overlap, newsz * sizeof(char));
+ q = reallocarray(overlap, newsz, sizeof(char));
if (q == NULL)
err(1, NULL);
memset(q + szchanges, 0, incr * sizeof(char));