Templatize.
[citadel.git] / webcit / msg_renderers.c
index 15abfddf5a67cd3d8e8fb7976fad4cfd4fab2ff3..d65d0d13bdd972a24268cd61c41c1b463adad73b 100644 (file)
@@ -1016,11 +1016,11 @@ void tmplput_EDIT_WIKI_BODY(StrBuf *Target, WCTemplputParams *TP)
         * to do it again.
         */
        if (!havebstr("attach_button")) {
-               char *wikipage = strdup(bstr("page"));
+               StrBuf *wikipage = NewStrBufDup(sbstr("page"));
                putbstr("format", NewStrBufPlain(HKEY("plain")));
                str_wiki_index(wikipage);
-               msgnum = locate_message_by_uid(wikipage);
-               free(wikipage);
+               msgnum = locate_message_by_uid(ChrPtr(wikipage));
+               FreeStrBuf(&wikipage);
                if (msgnum >= 0L) {
                        Buf = NewStrBuf();
                        read_message(Buf, HKEY("view_message_wikiedit"), msgnum, NULL, &Mime, TP);