chiark
/
gitweb
/
~mdw
/
secnet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
buffer: Provide buffer_destroy
[secnet]
/
util.c
diff --git
a/util.c
b/util.c
index 0f24282e772d17904092e5c5c7c9d1d465284fea..0215f257620b29955da29135aa332cf044bcf944 100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-291,6
+291,14
@@
void buffer_init(struct buffer_if *buffer, int32_t max_start_pad)
buffer->size=0;
}
buffer->size=0;
}
+void buffer_destroy(struct buffer_if *buf)
+{
+ BUF_ASSERT_FREE(buf);
+ free(buf->base);
+ buf->start=buf->base=0;
+ buf->size=buf->alloclen=0;
+}
+
void *buf_append(struct buffer_if *buf, int32_t amount) {
void *p;
assert(amount <= buf_remaining_space(buf));
void *buf_append(struct buffer_if *buf, int32_t amount) {
void *p;
assert(amount <= buf_remaining_space(buf));