aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2021-09-09 14:48:21 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2021-09-09 14:51:26 +0000
commit635eb7ac7990a2bb29e1992b739617a9db012bf2 (patch)
treeaa401d2b40e89bee26214801df578b5858a08935 /lib
parent187afc58791cd877c8ba0573b7826c31db8c6f73 (diff)
Diffstat (limited to 'lib')
-rw-r--r--lib/libfetch/http.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c
index 61f0f393ed98..bcb089dc0fc4 100644
--- a/lib/libfetch/http.c
+++ b/lib/libfetch/http.c
@@ -1526,12 +1526,13 @@ http_get_proxy(struct url * url, const char *flags)
static void
http_print_html(FILE *out, FILE *in)
{
- size_t len = 0;
+ ssize_t len = 0;
+ size_t cap;
char *line = NULL, *p, *q;
int comment, tag;
comment = tag = 0;
- while (getline(&line, &len, in) >= 0) {
+ while ((len = getline(&line, &cap, in)) >= 0) {
while (len && isspace((unsigned char)line[len - 1]))
--len;
for (p = q = line; q < line + len; ++q) {