From 56066894b7d14f71aeba8379f0d6e5961dee733e Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 23 Jun 2023 14:44:54 +0000 Subject: Apply fixes suggested by jjk Signed-off-by: Laurent Bercot --- src/libstddjb/buffer_getv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/libstddjb/buffer_getv.c') diff --git a/src/libstddjb/buffer_getv.c b/src/libstddjb/buffer_getv.c index 280a3b4..ab637a3 100644 --- a/src/libstddjb/buffer_getv.c +++ b/src/libstddjb/buffer_getv.c @@ -1,6 +1,7 @@ /* ISC license. */ -#include +#include + #include #include @@ -8,5 +9,5 @@ ssize_t buffer_getv (buffer *b, struct iovec const *v, unsigned int n) { size_t w = 0 ; ssize_t r = unsanitize_read(buffer_getvall(b, v, n, &w)) ; - return r <= 0 ? r : w ; + return r < 0 ? r : w ; } -- cgit v1.2.3