- char perma[SIZ];
-
- strcpy(perma, "/readfwd?go=");
- urlesc(&perma[strlen(perma)], sizeof(perma)-strlen(perma), (char *)ChrPtr(WC->CurRoom.name));
- snprintf(&perma[strlen(perma)], sizeof(perma)-strlen(perma), "?p=%d", WC->bptlid);
- if (!Target) {
- wc_printf("%s", perma);
- }
- else {
- StrBufAppendPrintf(Target, "%s", perma);
- }
+ StrBuf *buf = NewStrBufPlain(HKEY("/readfwd?go="));
+ StrBufUrlescAppend(buf, WC->CurRoom.name, 0);
+ StrBufAppendPrintf(buf, "?p=%d", WC->bptlid);
+ StrBufAppendTemplate(Target, TP, buf, 0);
+ FreeStrBuf(&buf);