summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/buf.c
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2007-02-02 04:24:10 +0000
committerRay Lai <ray@cvs.openbsd.org>2007-02-02 04:24:10 +0000
commit6922d99a37d1348e27229fd72eaa57d3f68118dd (patch)
tree47538539d859d915b318127285b98f778080305c /usr.bin/cvs/buf.c
parent6a91f83539b81a606795d6acb9612baef0a4e4d5 (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/cvs/buf.c')
-rw-r--r--usr.bin/cvs/buf.c36
1 files changed, 1 insertions, 35 deletions
diff --git a/usr.bin/cvs/buf.c b/usr.bin/cvs/buf.c
index 4f19552a752..71843d087f7 100644
--- a/usr.bin/cvs/buf.c
+++ b/usr.bin/cvs/buf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buf.c,v 1.55 2006/07/08 09:25:44 ray Exp $ */
+/* $OpenBSD: buf.c,v 1.56 2007/02/02 04:24:09 ray Exp $ */
/*
* Copyright (c) 2003 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -167,40 +167,6 @@ cvs_buf_empty(BUF *b)
}
/*
- * cvs_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.
- */
-ssize_t
-cvs_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)) {
- cvs_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);
-}
-
-/*
* cvs_buf_putc()
*
* Append a single character <c> to the end of the buffer <b>.