- filename = fmt("%s%s", ref, f->suffix);
- cgit_snapshot_link(filename, NULL, NULL, NULL, NULL, filename);
+ strbuf_setlen(&filename, prefixlen);
+ strbuf_addstr(&filename, f->suffix);
+ cgit_snapshot_link(filename.buf, NULL, NULL, NULL, NULL, filename.buf);