diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-12-01 21:58:47 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-12-01 21:58:47 +0000 |
commit | 63b1dc9d5d7158229afedc4c7c7db0d30a99c6b6 (patch) | |
tree | c3a9c79effa70af6f0f134fa99314869fe429e59 /usr.bin/rcs/diff.c | |
parent | e0af19e7664629a09fce64e756b718edfed96da1 (diff) |
An internal function called xrealloc() is actually a fail-hard
reallocarray()... so rename it.
Diffstat (limited to 'usr.bin/rcs/diff.c')
-rw-r--r-- | usr.bin/rcs/diff.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/rcs/diff.c b/usr.bin/rcs/diff.c index ecc29c7799c..b19dcd1224c 100644 --- a/usr.bin/rcs/diff.c +++ b/usr.bin/rcs/diff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.c,v 1.35 2014/10/10 08:15:25 otto Exp $ */ +/* $OpenBSD: diff.c,v 1.36 2014/12/01 21:58:46 deraadt Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. * All rights reserved. @@ -359,11 +359,11 @@ diffreg(const char *file1, const char *file2, BUF *out, int flags) member = (int *)file[1]; equiv(sfile[0], slen[0], sfile[1], slen[1], member); - member = xrealloc(member, slen[1] + 2, sizeof(*member)); + member = xreallocarray(member, slen[1] + 2, sizeof(*member)); class = (int *)file[0]; unsort(sfile[0], slen[0], class); - class = xrealloc(class, slen[0] + 2, sizeof(*class)); + class = xreallocarray(class, slen[0] + 2, sizeof(*class)); klist = xcalloc(slen[0] + 2, sizeof(*klist)); clen = 0; @@ -373,13 +373,13 @@ diffreg(const char *file1, const char *file2, BUF *out, int flags) xfree(member); xfree(class); - J = xrealloc(J, len[0] + 2, sizeof(*J)); + J = xreallocarray(J, len[0] + 2, sizeof(*J)); unravel(klist[i]); xfree(clist); xfree(klist); - ixold = xrealloc(ixold, len[0] + 2, sizeof(*ixold)); - ixnew = xrealloc(ixnew, len[1] + 2, sizeof(*ixnew)); + ixold = xreallocarray(ixold, len[0] + 2, sizeof(*ixold)); + ixnew = xreallocarray(ixnew, len[1] + 2, sizeof(*ixnew)); check(f1, f2, flags); output(f1, f2, flags); @@ -440,7 +440,7 @@ prepare(int i, FILE *fd, off_t filesize, int flags) for (j = 0; (h = readhash(fd, flags));) { if (j == sz) { sz = sz * 3 / 2; - p = xrealloc(p, sz + 3, sizeof(*p)); + p = xreallocarray(p, sz + 3, sizeof(*p)); } p[++j].value = h; } @@ -571,7 +571,7 @@ newcand(int x, int y, int pred) if (clen == clistlen) { clistlen = clistlen * 11 / 10; - clist = xrealloc(clist, clistlen, sizeof(*clist)); + clist = xreallocarray(clist, clistlen, sizeof(*clist)); } q = clist + clen; q->x = x; @@ -910,7 +910,7 @@ proceed: if (context_vec_ptr == context_vec_end - 1) { ptrdiff_t offset = context_vec_ptr - context_vec_start; max_context <<= 1; - context_vec_start = xrealloc(context_vec_start, + context_vec_start = xreallocarray(context_vec_start, max_context, sizeof(*context_vec_start)); context_vec_end = context_vec_start + max_context; context_vec_ptr = context_vec_start + offset; |