]> code.citadel.org Git - citadel.git/blobdiff - citadel/file_ops.c
more sprintf removals
[citadel.git] / citadel / file_ops.c
index 5d8a787280dae9dc08dde7789a68fdfe744de743..f6b3c90fcb3a83629e92492299eb9121f523d03a 100644 (file)
@@ -425,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]);
@@ -557,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) {
@@ -661,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,
@@ -699,7 +699,7 @@ void cmd_read(char *cmdbuf)
        }
 
        fseek(CC->download_fp, start_pos, 0);
-       bytes = fread(buf, bytes, 1, CC->download_fp);
+       fread(buf, bytes, 1, CC->download_fp);
        cprintf("%d %d\n", BINARY_FOLLOWS, bytes);
        client_write(buf, bytes);
 }