]> code.citadel.org Git - citadel.git/blobdiff - webcit/paramhandling.c
* upsie. that conversion to strbuf was still hanging around, heres the rest of it.
[citadel.git] / webcit / paramhandling.c
index 3aefcc9ea01a7464eeac38142a26ee83f525716f..e257e4517e61aecc38fc7efe21d6a45dae93cc8a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: paramhandling.c 6808 2008-12-11 00:00:36Z dothebart $
+ * $Id$
  *
  * parse urlparts and post data
  */
@@ -96,7 +96,7 @@ void dump_vars(void)
        Cursor = GetNewHashPos (WCC->Hdr->urlstrings, 0);
        while (GetNextHashPos(WCC->Hdr->urlstrings, Cursor, &HKLen, &HKey, &U)) {
                u = (urlcontent*) U;
-               wprintf("%38s = %s\n", u->url_key, ChrPtr(u->url_data));
+               wc_printf("%38s = %s\n", u->url_key, ChrPtr(u->url_data));
        }
 }
 
@@ -320,8 +320,7 @@ void upload_handler(char *name, char *filename, char *partnum, char *disp,
        if ( (length > 0) && (!IsEmptyStr(cbtype)) ) {
                WCC->upload = NewStrBufPlain(content, length);
                WCC->upload_length = length;
-               safestrncpy(WCC->upload_filename, filename,
-                           sizeof(WC->upload_filename));
+               WCC->upload_filename = NewStrBufPlain(filename, -1);
                safestrncpy(WCC->upload_content_type, cbtype,
                            sizeof(WC->upload_content_type));
                
@@ -371,19 +370,19 @@ void tmplput_bstr(StrBuf *Target, WCTemplputParams *TP)
 void diagnostics(void)
 {
        output_headers(1, 1, 1, 0, 0, 0);
-       wprintf("Session: %d<hr />\n", WC->wc_session);
-       wprintf("Command: <br /><PRE>\n");
+       wc_printf("Session: %d<hr />\n", WC->wc_session);
+       wc_printf("Command: <br /><PRE>\n");
 /*     
 StrEscPuts(WC->UrlFragment1);
-       wprintf("<br />\n");
+       wc_printf("<br />\n");
        StrEscPuts(WC->UrlFragment2);
-       wprintf("<br />\n");
+       wc_printf("<br />\n");
        StrEscPuts(WC->UrlFragment3);
 */
-       wprintf("</PRE><hr />\n");
-       wprintf("Variables: <br /><PRE>\n");
+       wc_printf("</PRE><hr />\n");
+       wc_printf("Variables: <br /><PRE>\n");
        dump_vars();
-       wprintf("</PRE><hr />\n");
+       wc_printf("</PRE><hr />\n");
        wDumpContent(1);
 }
 
@@ -441,4 +440,5 @@ SessionDetachModule_PARAMHANDLING
 (wcsession *sess)
 {
        DeleteHash(&sess->Hdr->urlstrings);
+       FreeStrBuf(&sess->upload_filename);
 }