chiark
/
gitweb
/
~ian
/
secnet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
buffers: Introduce buf_remaining_space
[secnet.git]
/
util.c
diff --git
a/util.c
b/util.c
index 3bfa6bb81afbca72ef26aed0741f62e10b8eeaee..de182a431445abdf34abc8b3f7dbf57f17ee919e 100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-254,7
+254,7
@@
void buffer_init(struct buffer_if *buffer, int32_t max_start_pad)
void *buf_append(struct buffer_if *buf, int32_t amount) {
void *p;
- assert(
buf->size <= buf->len - amount
);
+ assert(
amount <= buf_remaining_space(buf)
);
p=buf->start + buf->size;
buf->size+=amount;
return p;