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/fd_catn.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/libstddjb/fd_catn.c') diff --git a/src/libstddjb/fd_catn.c b/src/libstddjb/fd_catn.c index ca78546..b757853 100644 --- a/src/libstddjb/fd_catn.c +++ b/src/libstddjb/fd_catn.c @@ -1,20 +1,21 @@ /* ISC license. */ +#include #include #include #include #include -unsigned int fd_catn (int from, int to, unsigned int n) +size_t fd_catn (int from, int to, size_t n) { - unsigned int w = 0 ; + size_t w = 0 ; if (n >= IOBUFFER_SIZE) { iobuffer b ; if (!iobuffer_init(&b, from, to)) return 0 ; while (n >= IOBUFFER_SIZE) { - register int r = iobuffer_fill(&b) ; + register ssize_t r = iobuffer_fill(&b) ; if (r <= 0) { iobuffer_finish(&b) ; @@ -33,8 +34,8 @@ unsigned int fd_catn (int from, int to, unsigned int n) { char buf[n] ; - unsigned int r = allread(from, buf, n) ; - unsigned int v = 0 ; + size_t r = allread(from, buf, n) ; + size_t v = 0 ; if (r) v = allwrite(to, buf, r) ; w += v ; } -- cgit v1.2.3