+Mon Oct 14 07:54:17 1996 Ezra Peisach <epeisach@kangaroo.mit.edu>
+
+ * ftpd.c (secure_fprintf): Use STDARG routines if
+ present. [krb5-appl/108]
+
Tue Sep 10 14:07:36 1996 Tom Yu <tlyu@mit.edu>
* ftpd.M: remove ".so man1/header.doc"
* -1 on error
* -2 on security error
*/
+#ifdef STDARG
+secure_fprintf(FILE *stream, char *fmt, ...)
+#else
secure_fprintf(stream, fmt, p1, p2, p3, p4, p5)
FILE *stream;
char *fmt;
+#endif
{
- char s[FTP_BUFSIZ];
+ char s[FTP_BUFSIZ];
+ int rval;
+#ifdef STDARG
+ va_list ap;
- if (level == PROT_C)
- return(fprintf(stream, fmt, p1, p2, p3, p4, p5));
- sprintf(s, fmt, p1, p2, p3, p4, p5);
- return(secure_write(fileno(stream), s, strlen(s)));
+ va_start(ap, fmt);
+ if (level == PROT_C) rval = vfprintf(stream, fmt, ap);
+ else {
+ vsprintf(s, fmt, ap);
+ rval = secure_write(fileno(stream), s, strlen(s));
+ }
+ va_end(ap);
+
+ return(rval);
+#else
+ if (level == PROT_C)
+ return(fprintf(stream, fmt, p1, p2, p3, p4, p5));
+ sprintf(s, fmt, p1, p2, p3, p4, p5);
+ return(secure_write(fileno(stream), s, strlen(s)));
+#endif
}
send_file_list(whichfiles)