diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2007-02-21 04:09:55 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2007-02-21 04:09:55 +0000 |
commit | 37e747b0763424aed192ccdbcdf7e127858e2cf0 (patch) | |
tree | be84fc1b01528fb0d5571f4c7dca7340adabea08 /usr.bin/cvs | |
parent | f3d4c50eaef3ebc726227bda9a587805bca405e9 (diff) |
Replace a manual xrealloc with rcsnum_setsize.
From Charles Longeau <chl at tuxfamily dot org>.
OK joris@.
Diffstat (limited to 'usr.bin/cvs')
-rw-r--r-- | usr.bin/cvs/rcsnum.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/usr.bin/cvs/rcsnum.c b/usr.bin/cvs/rcsnum.c index afa22b5918f..b62c90b806b 100644 --- a/usr.bin/cvs/rcsnum.c +++ b/usr.bin/cvs/rcsnum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcsnum.c,v 1.40 2006/11/13 18:42:40 xsa Exp $ */ +/* $OpenBSD: rcsnum.c,v 1.41 2007/02/21 04:09:54 ray Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -150,16 +150,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))); } |