From d9349acd8c7813ac3bc17ef771803b40fdf1bcbc Mon Sep 17 00:00:00 2001 From: Ray Lai Date: Wed, 12 Apr 2006 07:56:59 +0000 Subject: xmalloc(); memset(); -> xcalloc(); OK xsa@ --- usr.bin/cvs/buf.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'usr.bin/cvs/buf.c') diff --git a/usr.bin/cvs/buf.c b/usr.bin/cvs/buf.c index 3b40e7069a4..eee3c889830 100644 --- a/usr.bin/cvs/buf.c +++ b/usr.bin/cvs/buf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buf.c,v 1.46 2006/04/11 00:49:49 ray Exp $ */ +/* $OpenBSD: buf.c,v 1.47 2006/04/12 07:56:58 ray Exp $ */ /* * Copyright (c) 2003 Jean-Francois Brousseau * All rights reserved. @@ -64,10 +64,9 @@ cvs_buf_alloc(size_t len, u_int flags) b = xmalloc(sizeof(*b)); /* Postpone creation of zero-sized buffers */ - if (len > 0) { - b->cb_buf = xmalloc(len); - memset(b->cb_buf, 0, len); - } else + if (len > 0) + b->cb_buf = xcalloc(1, len); + else b->cb_buf = NULL; b->cb_flags = flags; -- cgit v1.2.3