diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2006-04-12 07:56:59 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2006-04-12 07:56:59 +0000 |
commit | d9349acd8c7813ac3bc17ef771803b40fdf1bcbc (patch) | |
tree | ab15ed208f58c0e4ca4bb3ffc4cacb25ff4138d7 /usr.bin/cvs/buf.c | |
parent | 1cc870c55854e72d171b89cfe6a5c9f03adbace5 (diff) |
xmalloc(); memset(); -> xcalloc();
OK xsa@
Diffstat (limited to 'usr.bin/cvs/buf.c')
-rw-r--r-- | usr.bin/cvs/buf.c | 9 |
1 files changed, 4 insertions, 5 deletions
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 <jfb@openbsd.org> * 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; |