diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2007-03-02 04:53:18 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2007-03-02 04:53:18 +0000 |
commit | 5b3f6165185fde0cfa60cbcb08f04c98bc07b4ce (patch) | |
tree | d1776773e724f08a62bb8dc663c355a2c1edc913 /usr.bin/rcs | |
parent | ee4d88ad7057b1d6bc161923816bc92e608b5112 (diff) |
Sync rcsnum.c with OpenCVS, from Charles Longeau.
OK niallo@ and xsa@.
Diffstat (limited to 'usr.bin/rcs')
-rw-r--r-- | usr.bin/rcs/rcsnum.c | 9 |
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))); } |