Saner arg structure.

This commit is contained in:
Ian Gulliver
2016-02-15 21:12:26 +00:00
parent 9b97a2c32c
commit 798b75c30d
5 changed files with 39 additions and 33 deletions

View File

@@ -7,6 +7,11 @@
#include "common.h"
void buf_init(struct buf *buf) {
buf->start = 0;
buf->length = 0;
}
ssize_t buf_fill(struct buf *buf, int fd) {
if (buf->start + buf->length == BUF_LEN_MAX) {
assert(buf->start > 0);