summaryrefslogtreecommitdiff
path: root/src/libstddjb/slurpn.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstddjb/slurpn.c')
-rw-r--r--src/libstddjb/slurpn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstddjb/slurpn.c b/src/libstddjb/slurpn.c
index 317e300..d6a20da 100644
--- a/src/libstddjb/slurpn.c
+++ b/src/libstddjb/slurpn.c
@@ -16,7 +16,7 @@ int slurpn (int fd, stralloc *sa, size_t max)
ssize_t r ;
size_t n = max && sa->len + N > max ? max - sa->len : N ;
if (!n) return (errno = ENOBUFS, 0) ;
- if (!stralloc_readyplus(sa, n)) break ;
+ if (!stralloc_readyplus(sa, n)) return 0 ;
r = fd_read(fd, sa->s + sa->len, n) ;
switch (r)
{