diff options
Diffstat (limited to 'parse.c')
-rw-r--r-- | parse.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/parse.c b/parse.c index ab59fb2..07e8da0 100644 --- a/parse.c +++ b/parse.c @@ -22,7 +22,7 @@ void parse_plain_url(struct doc *d, strv_t ln, size_t i) { int parse_plain(struct doc *d, const str_t *b) { doc_init(d); - strv_t ln, buf = (strv_t) { b->buf, b->sz }; + strv_t ln, buf = strv(b); while (strv_split(&buf, '\n', &ln)) { if (ln.n > 0 && ln.s[ln.n - 1] == '\r') ln.n--; for (size_t j = 1; j + 2 < ln.n; j++) { @@ -62,7 +62,7 @@ int parse_gophermap(struct doc *d, const str_t *b) { switch (bits.item_type) { default: str_fmt(&url, "%s:%s/%c%s", bits.host, bits.port, bits.item_type, bits.sel); - doc_set_link(d, doc_add_link(d, (strv_t) { url.buf, url.sz })); + doc_set_link(d, doc_add_link(d, strv(url))); case 'i': doc_add_text(d, bits.dstr); doc_new_line(d); |