]> code.citadel.org Git - citadel.git/blobdiff - webcit/downloads.c
* fix crash in downloads.c; memset should prune SubTP not TP.
[citadel.git] / webcit / downloads.c
index d7b915c3c2d092842d6128ee11a0b8a31ecb748c..8544aabb9db93a88d75e50fd00595fadb94e9799 100644 (file)
@@ -175,7 +175,7 @@ HashList* LoadFileList(StrBuf *Target, WCTemplputParams *TP)
        int HavePic;
        WCTemplputParams SubTP;
 
-       memset(&TP, 0, sizeof(WCTemplputParams));
+       memset(&SubTP, 0, sizeof(WCTemplputParams));
        serv_puts("RDIR");
        serv_getln(buf, sizeof buf);
        if (buf[0] != '1') return NULL;
@@ -268,7 +268,7 @@ void download_file(void)
                hprintf("HTTP/1.1 404 %s\n", ChrPtr(Buf));
                output_headers(0, 0, 0, 0, 0, 0);
                hprintf("Content-Type: text/plain\r\n");
-               wprintf(_("An error occurred while retrieving this file: %s\n"), 
+               wc_printf(_("An error occurred while retrieving this file: %s\n"), 
                        ChrPtr(Buf));
                end_burst();
        }
@@ -438,9 +438,9 @@ InitModule_DOWNLOAD
 
        RegisterConditional(HKEY("COND:FILE:ISPIC"), 0, Conditional_FILE_ISPIC, CTX_FILELIST);
 
-       WebcitAddUrlHandler(HKEY("image"), output_image, ANONYMOUS);
-       WebcitAddUrlHandler(HKEY("display_mime_icon"), display_mime_icon , ANONYMOUS);
-       WebcitAddUrlHandler(HKEY("download_file"), download_file, NEED_URL);
-       WebcitAddUrlHandler(HKEY("delete_file"), delete_file, NEED_URL);
-       WebcitAddUrlHandler(HKEY("upload_file"), upload_file, 0);
+       WebcitAddUrlHandler(HKEY("image"), "", 0, output_image, ANONYMOUS);
+       WebcitAddUrlHandler(HKEY("display_mime_icon"), "", 0, display_mime_icon , ANONYMOUS);
+       WebcitAddUrlHandler(HKEY("download_file"), "", 0, download_file, NEED_URL);
+       WebcitAddUrlHandler(HKEY("delete_file"), "", 0, delete_file, NEED_URL);
+       WebcitAddUrlHandler(HKEY("upload_file"), "", 0, upload_file, 0);
 }