commit 4fb0feda816f055d3b2e692baab18cf14af168d4
parent 40d5897b2aada68f0789cd7e7154705cc3c0ad49
Author: Amitai Schleier <schmonz-web-git@schmonz.com>
Date: Thu, 17 Dec 2020 10:30:53 +0100
Catch up to ssize_t changes across substdio.
Diffstat:
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/substdi.c b/substdi.c
@@ -43,16 +43,14 @@ ssize_t substdio_feed(substdio *s)
return r;
}
-int substdio_bget(s,buf,len)
-register substdio *s;
-register char *buf;
-register int len;
+ssize_t substdio_bget(substdio *s, char *buf, size_t len)
{
- register int r;
+ ssize_t r;
if (s->p > 0) return getthis(s,buf,len);
r = s->n; if (r <= len) return oneread(s->op,s->fd,buf,r);
- r = substdio_feed(s); if (r <= 0) return r;
+ r = substdio_feed(s);
+ if (r == 0 || r == -1) return r;
return getthis(s,buf,len);
}
diff --git a/substdio.h b/substdio.h
@@ -24,7 +24,7 @@ extern int substdio_bputs();
extern int substdio_putsflush();
extern ssize_t substdio_get(substdio *s, char *buf, size_t len);
-extern int substdio_bget();
+extern ssize_t substdio_bget(substdio *s, char *buf, size_t len);
extern ssize_t substdio_feed(substdio *s);
extern char *substdio_peek();