mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04: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
1 changed files with 3 additions and 2 deletions
|
|
@ -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