summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/hist.c
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2006-04-05 01:38:57 +0000
committerRay Lai <ray@cvs.openbsd.org>2006-04-05 01:38:57 +0000
commit0898160056a31f0981cae42f585dce85844d89b7 (patch)
tree2ab8437cd5dbf0558b5d3f90f54443694d8a7d53 /usr.bin/cvs/hist.c
parent83701e885596de792fb8b058bf3e19ceb443a245 (diff)
Use variable names for sizeof, remove casts in front of xmalloc,
use xcalloc and xstrdup where appropriate, and other stuff. OK joris@
Diffstat (limited to 'usr.bin/cvs/hist.c')
-rw-r--r--usr.bin/cvs/hist.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/cvs/hist.c b/usr.bin/cvs/hist.c
index 1bf36d3f050..93dbf1fe5be 100644
--- a/usr.bin/cvs/hist.c
+++ b/usr.bin/cvs/hist.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hist.c,v 1.13 2006/01/02 08:11:56 xsa Exp $ */
+/* $OpenBSD: hist.c,v 1.14 2006/04/05 01:38:55 ray Exp $ */
/*
* Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -48,10 +48,9 @@ cvs_hist_open(const char *path)
{
CVSHIST *histp;
- histp = (CVSHIST *)xmalloc(sizeof(*histp));
- memset(histp, 0, sizeof(*histp));
+ histp = xcalloc(1, sizeof(*histp));
- histp->chf_buf = (char *)xmalloc((size_t)CVS_HIST_BUFSIZE);
+ histp->chf_buf = xmalloc((size_t)CVS_HIST_BUFSIZE);
histp->chf_blen = CVS_HIST_BUFSIZE;
histp->chf_off = 0;