summaryrefslogtreecommitdiffstats
path: root/usr.bin/cvs/diff3.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2014-12-01 21:58:46 +0000
committerderaadt <deraadt@openbsd.org>2014-12-01 21:58:46 +0000
commitcaa2ffb0b03850db17af0f8c10b96ed868191c3f (patch)
treee4a3ca634b548c220db17e0f4f17351d7a2dd572 /usr.bin/cvs/diff3.c
parentreconvert (rereconvert?) to memcpy except in the one case where memmove (diff)
downloadwireguard-openbsd-caa2ffb0b03850db17af0f8c10b96ed868191c3f.tar.xz
wireguard-openbsd-caa2ffb0b03850db17af0f8c10b96ed868191c3f.zip
An internal function called xrealloc() is actually a fail-hard
reallocarray()... so rename it.
Diffstat (limited to 'usr.bin/cvs/diff3.c')
-rw-r--r--usr.bin/cvs/diff3.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/cvs/diff3.c b/usr.bin/cvs/diff3.c
index df5eae89d8b..5f0d95e31ab 100644
--- a/usr.bin/cvs/diff3.c
+++ b/usr.bin/cvs/diff3.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff3.c,v 1.55 2012/03/04 04:05:15 fgsch Exp $ */
+/* $OpenBSD: diff3.c,v 1.56 2014/12/01 21:58:46 deraadt Exp $ */
/*
* Copyright (C) Caldera International Inc. 2001-2002.
@@ -528,7 +528,7 @@ get_line(FILE *b, size_t *n)
do {
bufsize += 1024;
} while (len + 1 > bufsize);
- buf = xrealloc(buf, 1, bufsize);
+ buf = xreallocarray(buf, 1, bufsize);
}
memcpy(buf, cp, len - 1);
buf[len - 1] = '\n';
@@ -825,13 +825,13 @@ increase(void)
newsz = szchanges == 0 ? 64 : 2 * szchanges;
incr = newsz - szchanges;
- d13 = xrealloc(d13, newsz, sizeof(*d13));
+ d13 = xreallocarray(d13, newsz, sizeof(*d13));
memset(d13 + szchanges, 0, incr * sizeof(*d13));
- d23 = xrealloc(d23, newsz, sizeof(*d23));
+ d23 = xreallocarray(d23, newsz, sizeof(*d23));
memset(d23 + szchanges, 0, incr * sizeof(*d23));
- de = xrealloc(de, newsz, sizeof(*de));
+ de = xreallocarray(de, newsz, sizeof(*de));
memset(de + szchanges, 0, incr * sizeof(*de));
- overlap = xrealloc(overlap, newsz, sizeof(*overlap));
+ overlap = xreallocarray(overlap, newsz, sizeof(*overlap));
memset(overlap + szchanges, 0, incr * sizeof(*overlap));
szchanges = newsz;
}