- dstr_ensure(&buf, st.st_size + 1);
- if ((i = readlink(d.buf, buf.buf, buf.sz)) < 0) {
- report(cp, CP_ERROR, 0, d.buf, "can't readlink: %e");
+ dstr_reset(&state->link);
+ dstr_ensure(&state->link, st.st_size + 1);
+ if ((i = readlink(state->path.buf,
+ state->link.buf, state->link.sz)) < 0) {
+ report(state, cp, CP_ERROR, 0, state->path.buf,
+ "can't readlink: %e");