diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2007-02-02 04:24:10 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2007-02-02 04:24:10 +0000 |
commit | 6922d99a37d1348e27229fd72eaa57d3f68118dd (patch) | |
tree | 47538539d859d915b318127285b98f778080305c /usr.bin/rcs/buf.c | |
parent | 6a91f83539b81a606795d6acb9612baef0a4e4d5 (diff) |
Remove unused and buggy {cvs,rcs}_buf_set functions.
Bugginess pointed out and fix provided by Pierre Riteau.
OK joris@.
Diffstat (limited to 'usr.bin/rcs/buf.c')
-rw-r--r-- | usr.bin/rcs/buf.c | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/usr.bin/rcs/buf.c b/usr.bin/rcs/buf.c index bb52670ffb2..19b22375b6a 100644 --- a/usr.bin/rcs/buf.c +++ b/usr.bin/rcs/buf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buf.c,v 1.8 2006/08/16 07:39:15 ray Exp $ */ +/* $OpenBSD: buf.c,v 1.9 2007/02/02 04:24:09 ray Exp $ */ /* * Copyright (c) 2003 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -190,40 +190,6 @@ rcs_buf_empty(BUF *b) } /* - * rcs_buf_set() - * - * Set the contents of the buffer <b> at offset <off> to the first <len> - * bytes of data found at <src>. If the buffer was not created with - * BUF_AUTOEXT, as many bytes as possible will be copied in the buffer. - */ -size_t -rcs_buf_set(BUF *b, const void *src, size_t len, size_t off) -{ - size_t rlen = 0; - - if (b->cb_size < (len + off)) { - if ((b->cb_flags & BUF_AUTOEXT)) { - rcs_buf_grow(b, len + off - b->cb_size); - rlen = len + off; - } else { - rlen = b->cb_size - off; - } - } else { - rlen = len; - } - - b->cb_len = rlen; - memcpy((b->cb_buf + off), src, rlen); - - if (b->cb_len == 0) { - b->cb_cur = b->cb_buf + off; - b->cb_len = rlen; - } - - return (rlen); -} - -/* * rcs_buf_putc() * * Append a single character <c> to the end of the buffer <b>. |