summaryrefslogtreecommitdiff
path: root/src/libunixonacid/unixmessage_put.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libunixonacid/unixmessage_put.c')
-rw-r--r--src/libunixonacid/unixmessage_put.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libunixonacid/unixmessage_put.c b/src/libunixonacid/unixmessage_put.c
index 908bc31..015264a 100644
--- a/src/libunixonacid/unixmessage_put.c
+++ b/src/libunixonacid/unixmessage_put.c
@@ -49,7 +49,7 @@ static inline int copyfds (char *s, int const *fds, unsigned int n, unsigned cha
static int reserve_and_copy (unixmessage_sender_t *b, unsigned int len, int const *fds, unsigned int nfds, unsigned char const *bits)
{
- diuint cur = { .left = b->data.len, .right = b->fds.len } ;
+ diuint cur = { .left = b->data.len, .right = genalloc_len(int, &b->fds) } ;
if (len > UNIXMESSAGE_MAXSIZE || nfds > UNIXMESSAGE_MAXFDS)
return (errno = EPROTO, 0) ;
if (!genalloc_readyplus(diuint, &b->offsets, 1)
@@ -57,7 +57,7 @@ static int reserve_and_copy (unixmessage_sender_t *b, unsigned int len, int cons
|| !stralloc_readyplus(&b->data, len))
return 0 ;
if (!copyfds(b->fds.s + b->fds.len, fds, nfds, bits)) return 0 ;
- b->fds.len += nfds * sizeof(int) ;
+ genalloc_setlen(int, &b->fds, cur.right + nfds) ;
byte_copy(b->offsets.s + b->offsets.len, sizeof(diuint), (char const *)&cur) ;
b->offsets.len += sizeof(diuint) ;
return 1 ;