From a896ca2a8c617e5e00ffd5fc9e69331ad754e5b3 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 15 Feb 2017 17:40:40 +0000 Subject: add arc4random_addrandom sysdep; next batch of types changes. The library isn't supposed to be functional yet: there are still a lot of type mismatches. --- src/libstddjb/stralloc_catv.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/libstddjb/stralloc_catv.c') diff --git a/src/libstddjb/stralloc_catv.c b/src/libstddjb/stralloc_catv.c index 1649f4c..684829c 100644 --- a/src/libstddjb/stralloc_catv.c +++ b/src/libstddjb/stralloc_catv.c @@ -1,21 +1,22 @@ /* ISC license. */ -#include -#include +#include +#include +#include #include -int stralloc_catv (stralloc *sa, siovec_t const *v, unsigned int n) +int stralloc_catv (stralloc *sa, struct iovec const *v, unsigned int n) { register unsigned int i = 0 ; { - unsigned int total = 0 ; - for (; i < n ; i++) total += v[i].len ; + size_t total = 0 ; + for (; i < n ; i++) total += v[i].iov_len ; if (!stralloc_readyplus(sa, total)) return 0 ; } for (i = 0 ; i < n ; i++) { - byte_copy(sa->s + sa->len, v[i].len, v[i].s) ; - sa->len += v[i].len ; + memmove(sa->s + sa->len, v[i].iov_base, v[i].iov_len) ; + sa->len += v[i].iov_len ; } return 1 ; } -- cgit v1.3.1