#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"
char filename[SIZ];
char pathname[SIZ];
struct usersupp usbuf;
- char which_user[32];
+ char which_user[USERNAME_SIZE];
int which_floor;
int a;
"NEW UPLOAD: '%s'\n %s\n",
CC->upl_file, CC->upl_comment);
quickie_message(CC->curr_user, NULL, CC->quickroom.QRname,
- upload_notice);
+ upload_notice, 0, NULL);
} else {
abort_upl(CC);
cprintf("%d File '%s' aborted.\n", CIT_OK, CC->upl_path);
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);
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);
}