diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-03-15 17:36:19 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-03-15 17:36:19 +0000 |
commit | ec99de4572e4130d4ec1a04a8081cca1ab202495 (patch) | |
tree | e28b3270fe876e34bc5b5039e3eda62c148ea1ca | |
parent | 21bf9df13cad0da20ecd9fadfa54cd16479238aa (diff) | |
download | skalibs-ec99de4572e4130d4ec1a04a8081cca1ab202495.tar.xz |
Fix unixmessage_putv() (the normal message wasn't taken into account!)
-rw-r--r-- | src/libstddjb/siovec_gather.c | 2 | ||||
-rw-r--r-- | src/libunixonacid/unixmessage_put.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libstddjb/siovec_gather.c b/src/libstddjb/siovec_gather.c index c4138b6..a037b0c 100644 --- a/src/libstddjb/siovec_gather.c +++ b/src/libstddjb/siovec_gather.c @@ -11,7 +11,7 @@ size_t siovec_gather (struct iovec const *v, unsigned int n, char *s, size_t max for (; i < n && w < max ; i++) { size_t len = v[i].iov_len ; - if ((w + len) > max) len = max - w ; + if (len > max - w) len = max - w ; memmove(s + w, v[i].iov_base, len) ; w += len ; } diff --git a/src/libunixonacid/unixmessage_put.c b/src/libunixonacid/unixmessage_put.c index d9fe306..528c3b8 100644 --- a/src/libunixonacid/unixmessage_put.c +++ b/src/libunixonacid/unixmessage_put.c @@ -72,6 +72,6 @@ int unixmessage_putv_and_close (unixmessage_sender_t *b, unixmessage_v_t const * { size_t len = siovec_len(m->v, m->vlen) ; if (!reserve_and_copy(b, len, m->fds, m->nfds, bits)) return 0 ; - siovec_gather(m->v, m->vlen, b->data.s + b->data.len, len) ; + b->data.len += siovec_gather(m->v, m->vlen, b->data.s + b->data.len, len) ; return 1 ; } |