mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-07 00:50:50 +00:00
fetch: do not confuse capacity and length
The patch converting fetch to getline
(ee3ca711a8
),
did confuse the capacity of the line buffer with the actual len of the read
line confusing fetch -v.
This commit is contained in:
parent
187afc5879
commit
635eb7ac79
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue