* ftpd.c (secure_fprintf): Use STDARG routines if
authorEzra Peisach <epeisach@mit.edu>
Mon, 14 Oct 1996 12:00:58 +0000 (12:00 +0000)
committerEzra Peisach <epeisach@mit.edu>
Mon, 14 Oct 1996 12:00:58 +0000 (12:00 +0000)
present. [krb5-appl/108]

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9168 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/gssftp/ftpd/ChangeLog
src/appl/gssftp/ftpd/ftpd.c

index a510b6b44ea2c1a126c78ba94dec2030c0d281d4..9b7f36cf658ed7d414da5182d6ff0dc841ab21ea 100644 (file)
@@ -1,3 +1,8 @@
+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"
index 046077099747b5e251cec075793aed3894a7f35d..df29b8f1d489b42d6f4f749a75b6e0ac33cbf3bb 100644 (file)
@@ -2078,16 +2078,34 @@ static char *onefile[] = {
  *     -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)