diff options
Diffstat (limited to 'smtpd/iobuf.c')
-rw-r--r-- | smtpd/iobuf.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/smtpd/iobuf.c b/smtpd/iobuf.c index 227e41fc..a9e4a2de 100644 --- a/smtpd/iobuf.c +++ b/smtpd/iobuf.c @@ -47,7 +47,7 @@ iobuf_init(struct iobuf *io, size_t size, size_t max) if (size == 0) size = max; - + if (size > max) return (-1); @@ -68,7 +68,7 @@ iobuf_clear(struct iobuf *io) if (io->buf) free(io->buf); - while((q = io->outq)) { + while ((q = io->outq)) { io->outq = q->next; free(q); } @@ -82,7 +82,7 @@ iobuf_drain(struct iobuf *io, size_t n) struct ioqbuf *q; size_t left = n; - while((q = io->outq) && left) { + while ((q = io->outq) && left) { if ((q->wpos - q->rpos) > left) { q->rpos += left; left = 0; @@ -180,7 +180,7 @@ iobuf_getline(struct iobuf *iobuf, size_t *rlen) return (buf); } - return (NULL); + return (NULL); } void @@ -231,9 +231,9 @@ ioqbuf_alloc(struct iobuf *io, size_t len) return (NULL); q->rpos = 0; - q->wpos = 0; - q->size = len; - q->next = NULL; + q->wpos = 0; + q->size = len; + q->next = NULL; q->buf = (char *)(q) + sizeof(*q); if (io->outqlast == NULL) @@ -295,13 +295,13 @@ iobuf_queuev(struct iobuf *io, const struct iovec *iov, int iovcnt) size_t len = 0; char *buf; - for(i = 0; i < iovcnt; i++) + for (i = 0; i < iovcnt; i++) len += iov[i].iov_len; if ((buf = iobuf_reserve(io, len)) == NULL) return (-1); - for(i = 0; i < iovcnt; i++) { + for (i = 0; i < iovcnt; i++) { if (iov[i].iov_len == 0) continue; memmove(buf, iov[i].iov_base, iov[i].iov_len); @@ -351,7 +351,7 @@ iobuf_write(struct iobuf *io, int fd) ssize_t n; i = 0; - for(q = io->outq; q ; q = q->next) { + for (q = io->outq; q ; q = q->next) { if (i >= IOV_MAX) break; iov[i].iov_base = q->buf + q->rpos; |