use the gnu format string checker for CtdlLogPrintf; fix associated new warnings...
[citadel.git] / citadel / file_ops.c
index 2e7c4f707e0dfc84c48efed2ff03d50a00194be4..ee2e93a05f2ddae13451f3ca52bad8746b328114 100644 (file)
@@ -48,9 +48,9 @@
 /*
  * network_talking_to()  --  concurrency checker
  */
+static char *nttlist = NULL;
 int network_talking_to(char *nodename, int operation) {
 
-       static char *nttlist = NULL;
        char *ptr = NULL;
        int i;
        char buf[SIZ];
@@ -102,6 +102,14 @@ int network_talking_to(char *nodename, int operation) {
        return(retval);
 }
 
+void cleanup_nttlist(void)
+{
+        begin_critical_section(S_NTTLIST);
+       if (nttlist != NULL)
+               free(nttlist);
+       nttlist = NULL;
+        end_critical_section(S_NTTLIST);
+}
 
 
 
@@ -593,7 +601,7 @@ void cmd_ucls(char *cmd)
                                unlink(CC->upl_path);
                        }
                        else {
-                               CtdlLogPrintf(CTDL_ALERT, "Cannot link %d to %d: %s\n",
+                               CtdlLogPrintf(CTDL_ALERT, "Cannot link %s to %s: %s\n",
                                        CC->upl_path, final_filename, strerror(errno)
                                );
                        }
@@ -824,6 +832,7 @@ CTDL_MODULE_INIT(file_ops)
                CtdlRegisterProtoHook(cmd_nuop, "NUOP", "Open a network spool file for upload");
                CtdlRegisterProtoHook(cmd_oimg, "OIMG", "Open an image file for download");
                CtdlRegisterProtoHook(cmd_uimg, "UIMG", "Upload an image file");
+               CtdlRegisterCleanupHook(cleanup_nttlist);
        }
         /* return our Subversion id for the Log */
        return "file_ops";