]> code.citadel.org Git - citadel.git/blobdiff - citadel/file_ops.c
more sprintf removals
[citadel.git] / citadel / file_ops.c
index a04dc32c9b38ab312e02ba1ef8bb34ba0eb9827c..f6b3c90fcb3a83629e92492299eb9121f523d03a 100644 (file)
@@ -44,6 +44,9 @@
 #include "tools.h"
 #include "citserver.h"
 
+#ifndef HAVE_SNPRINTF
+#include "snprintf.h"
+#endif
 
 /*
  * network_talking_to()  --  concurrency checker
@@ -260,7 +263,7 @@ void cmd_netf(char *cmdbuf)
        }
        snprintf(buf, sizeof buf, "sysop@%s", destsys);
        e = alias(buf);
-       if (e != MES_BINARY) {
+       if (e != MES_IGNET) {
                cprintf("%d No such system: '%s'\n",
                        ERROR + NO_SUCH_SYSTEM, destsys);
                return;
@@ -328,7 +331,7 @@ void OpenCmdResult(char *filename, char *mime_type)
        modtime = (time_t) statbuf.st_mtime;
 
        cprintf("%d %ld|%ld|%s|%s\n",
-               OK, filesize, modtime, filename, mime_type);
+               OK, filesize, (long)modtime, filename, mime_type);
 }
 
 
@@ -422,7 +425,7 @@ void cmd_oimg(char *cmdbuf)
                snprintf(pathname, sizeof pathname,
                         "./images/floor.%d.gif", which_floor);
        } else if (!strcasecmp(filename, "_roompic_")) {
-               assoc_file_name(pathname, &CC->quickroom, "images");
+               assoc_file_name(pathname, sizeof pathname, &CC->quickroom, "images");
        } else {
                for (a = 0; a < strlen(filename); ++a) {
                        filename[a] = tolower(filename[a]);
@@ -554,7 +557,7 @@ void cmd_uimg(char *cmdbuf)
        }
 
        if ((!strcasecmp(basenm, "_roompic_")) && (is_room_aide())) {
-               assoc_file_name(CC->upl_path, &CC->quickroom, "images");
+               assoc_file_name(CC->upl_path, sizeof CC->upl_path, &CC->quickroom, "images");
        }
 
        if (strlen(CC->upl_path) == 0) {
@@ -658,7 +661,7 @@ void cmd_ucls(char *cmd)
                }
 
                /* put together an upload notice */
-               sprintf(upload_notice,
+               snprintf(upload_notice, sizeof upload_notice,
                        "NEW UPLOAD: '%s'\n %s\n",
                        CC->upl_file, CC->upl_comment);
                quickie_message(CC->curr_user, NULL, CC->quickroom.QRname,
@@ -777,7 +780,7 @@ void cmd_ndop(char *cmdbuf)
        CC->dl_is_net = 1;
 
        stat(pathname, &statbuf);
-       cprintf("%d %ld\n", OK, statbuf.st_size);
+       cprintf("%d %ld\n", OK, (long)statbuf.st_size);
 }
 
 /*