aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
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) {