]> code.citadel.org Git - citadel.git/blobdiff - citadel/file_ops.c
* Renamed "dynloader" to "serv_extensions" globally. We don't want people
[citadel.git] / citadel / file_ops.c
index 911138168b57dff34c5fcbcbf634c9adfb6b11f3..c9ab9b1566eec6060f2976a88a0ff86eecea19af 100644 (file)
@@ -33,7 +33,7 @@
 #include <limits.h>
 #include "citadel.h"
 #include "server.h"
-#include "dynloader.h"
+#include "serv_extensions.h"
 #include "config.h"
 #include "file_ops.h"
 #include "sysdep_decls.h"
@@ -393,7 +393,7 @@ void cmd_oimg(char *cmdbuf)
        char filename[SIZ];
        char pathname[SIZ];
        struct usersupp usbuf;
-       char which_user[32];
+       char which_user[USERNAME_SIZE];
        int which_floor;
        int a;
 
@@ -665,7 +665,7 @@ void cmd_ucls(char *cmd)
                        "NEW UPLOAD: '%s'\n %s\n",
                        CC->upl_file, CC->upl_comment);
                quickie_message(CC->curr_user, NULL, CC->quickroom.QRname,
-                               upload_notice, 0);
+                               upload_notice, 0, NULL);
        } else {
                abort_upl(CC);
                cprintf("%d File '%s' aborted.\n", CIT_OK, CC->upl_path);
@@ -680,7 +680,8 @@ void cmd_ucls(char *cmd)
 void cmd_read(char *cmdbuf)
 {
        long start_pos;
-       int bytes;
+       size_t bytes;
+       size_t actual_bytes;
        char buf[4096];
 
        start_pos = extract_long(cmdbuf, 0);
@@ -692,16 +693,12 @@ void cmd_read(char *cmdbuf)
                return;
        }
 
-       if (bytes > 4096) {
-               cprintf("%d You may not read more than 4096 bytes.\n",
-                       ERROR);
-               return;
-       }
+       if (bytes > 4096) bytes = 4096;
 
        fseek(CC->download_fp, start_pos, 0);
-       fread(buf, bytes, 1, CC->download_fp);
-       cprintf("%d %d\n", BINARY_FOLLOWS, bytes);
-       client_write(buf, bytes);
+       actual_bytes = fread(buf, 1, bytes, CC->download_fp);
+       cprintf("%d %d\n", BINARY_FOLLOWS, (int)actual_bytes);
+       client_write(buf, actual_bytes);
 }