"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, actual_bytes);
+ client_write(buf, actual_bytes);
}