+Fri Feb 13 22:23:34 1998 Theodore Y. Ts'o <tytso@mit.edu>
+
+ * ftpd.c: Applied lxs's changes to make ftpd safe for systems
+ where sizeof(off_t) > sizeof(int).
+
Fri Feb 13 15:31:46 1998 Theodore Ts'o <tytso@rsts-11.mit.edu>
* Makefile.in (thisconfigdir), configure.in: Point the
int swaitint = SWAITINT;
void lostconn(), myoob();
-FILE *getdatasock(), *dataconn();
+FILE *getdatasock();
+#if defined(__STDC__)
+/*
+ * The following prototypes must be ANSI for systems for which
+ * sizeof(off_t) > sizeof(int) to prevent stack overflow problems
+ */
+FILE *dataconn(char *name, off_t size, char *mode);
+void send_data(FILE *instr, FILE *outstr, off_t blksize);
+#else
+void send_data();
+FILE *dataconn();
+#endif
#ifdef SETPROCTITLE
char **Argv = NULL; /* pointer to argument vector */
file_size = size;
byte_count = 0;
if (size != (off_t) -1)
- (void) sprintf (sizebuf, " (%ld bytes)", size);
+ /* cast size to long in case sizeof(off_t) > sizeof(long) */
+ (void) sprintf (sizebuf, " (%ld bytes)", (long)size);
else
(void) strcpy(sizebuf, "");
if (pdata >= 0) {
*
* NB: Form isn't handled.
*/
-send_data(instr, outstr, blksize)
+void send_data(instr, outstr, blksize)
FILE *instr, *outstr;
off_t blksize;
{