+2002-11-08 Ken Raeburn <raeburn@mit.edu>
+
+ * main.c (makeargv): Report an error if parsed arguments won't fit
+ in margv array.
+ * ftp_var.h (line, argbuf): Extend to 500 bytes.
+
2002-08-29 Ken Raeburn <raeburn@mit.edu>
* Makefile.in: Revert $(S)=>/ change, for Windows support.
#include <setjmp.h>
extern jmp_buf toplevel; /* non-local goto stuff for cmd scanner */
-extern char line[200]; /* input line buffer */
+extern char line[500]; /* input line buffer */
extern char *stringbase; /* current scan point in line buffer */
-extern char argbuf[200]; /* argument storage buffer */
+extern char argbuf[500]; /* argument storage buffer */
extern char *argbase; /* current storage point in arg buffer */
extern int margc; /* count of arguments on input line */
extern char *margv[20]; /* args parsed from input line */
stringbase = line; /* scan from first of buffer */
argbase = argbuf; /* store from first of buffer */
slrflag = 0;
- while ((*argp++ = slurpstring()))
+ while ((*argp++ = slurpstring())) {
margc++;
+ if (margc == sizeof(margv)/sizeof(margv[0])) {
+ printf("sorry, too many arguments in input line\n");
+ margc = 0;
+ margv[0] = 0;
+ return;
+ }
+ }
}
/*