summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorray <ray@openbsd.org>2007-03-02 04:53:17 +0000
committerray <ray@openbsd.org>2007-03-02 04:53:17 +0000
commit58088837ad69231d58ecdd8536b7717df09e2dab (patch)
treea63a0680c4aeaee74ac416666e3f6e96ad6861a7
parentstrlen fixes from Charles Longeau. (diff)
downloadwireguard-openbsd-58088837ad69231d58ecdd8536b7717df09e2dab.tar.xz
wireguard-openbsd-58088837ad69231d58ecdd8536b7717df09e2dab.zip
Sync rcsnum.c with OpenCVS, from Charles Longeau.
OK niallo@ and xsa@.
-rw-r--r--usr.bin/rcs/rcsnum.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/usr.bin/rcs/rcsnum.c b/usr.bin/rcs/rcsnum.c
index 34045d782e4..894335e6594 100644
--- a/usr.bin/rcs/rcsnum.c
+++ b/usr.bin/rcs/rcsnum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcsnum.c,v 1.4 2007/02/27 07:59:13 xsa Exp $ */
+/* $OpenBSD: rcsnum.c,v 1.5 2007/03/02 04:53:17 ray Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -153,16 +153,13 @@ void
rcsnum_cpy(const RCSNUM *nsrc, RCSNUM *ndst, u_int depth)
{
u_int len;
- void *tmp;
len = nsrc->rn_len;
if (depth != 0 && len > depth)
len = depth;
- tmp = xrealloc(ndst->rn_id, len, sizeof(*(nsrc->rn_id)));
- ndst->rn_id = tmp;
- ndst->rn_len = len;
- /* Overflow checked in xrealloc(). */
+ rcsnum_setsize(ndst, len);
+ /* Overflow checked in rcsnum_setsize(). */
(void)memcpy(ndst->rn_id, nsrc->rn_id,
len * sizeof(*(nsrc->rn_id)));
}