diff options
Diffstat (limited to 'net.c')
-rw-r--r-- | net.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net.c b/net.c index 0d6604e..87fe659 100644 --- a/net.c +++ b/net.c @@ -129,12 +129,12 @@ static int fetch_file(const struct addr *adr, struct buf *buf, enum doc_type *do perr("file not found"); return -1; } - buf_init(buf, 1024); + str_init(buf, 1024); char b[256]; while (fgets(b, sizeof b, f)) { - buf_cat(buf, strv(b)); + str_cat(buf, strv(b)); } - buf_catc(buf, 0); + str_catc(buf, 0); fclose(f); *doct = DOC_PLAIN; return 0; @@ -173,18 +173,18 @@ static int fetch_gopher(const struct addr *adr, struct buf *buf, enum doc_type * perr("write failure"); return -1; } - buf_init(buf, 64); + str_init(buf, 64); char inbuf[256]; for (;;) { ssize_t n = read(s, inbuf, sizeof inbuf); if (n < 0) { perr("read error"); - buf_free(buf); + str_free(buf); close(s); return -1; } if (!n) break; - buf_cat(buf, (strv_t) { inbuf, n }); + str_cat(buf, (strv_t) { inbuf, n }); } close(s); return 0; |