+Thu Jan 11 11:27:04 1996 Ezra Peisach <epeisach@kangaroo.mit.edu>
+
+ * krcp.c (error): Convert to use varargs.
+
+ * configure.in: Check for stdarg.h
+
Wed Jan 10 21:26:20 1996 Theodore Y. Ts'o <tytso@dcl>
* kcmd.c (getport): Clear the sin structure to be zero. (From
AC_FUNC_CHECK(openpty,AC_DEFINE(HAVE_OPENPTY))
AC_FUNC_CHECK(setlogin,AC_DEFINE(HAVE_SETLOGIN))
AC_FUNC_CHECK(logwtmp,AC_DEFINE(HAVE_LOGWTMP))
-AC_CHECK_HEADERS(unistd.h stdlib.h string.h sys/filio.h sys/sockio.h sys/label.h sys/tty.h ttyent.h lastlog.h sys/select.h sys/ptyvar.h utmp.h utmpx.h)
+AC_CHECK_HEADERS(unistd.h stdlib.h string.h sys/filio.h sys/sockio.h)
+AC_CHECK_HEADERS(sys/label.h sys/tty.h ttyent.h lastlog.h sys/select.h)
+AC_CHECK_HEADERS(sys/ptyvar.h utmp.h utmpx.h stdarg.h)
AC_REPLACE_FUNCS(getdtablesize)
DECLARE_SYS_ERRLIST
KRB5_SIGTYPE
#ifdef HAVE_VFORK_H
#include <vfork.h>
#endif
+#ifdef HAVE_STDARG_H
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
#ifdef HAVE_SETRESUID
#ifndef HAVE_SETREUID
#define NULLBUF (struct buffer *) 0
- /*VARARGS*/
- int error();
+#ifdef HAVE_STDARG_H
+int error KRB5_PROTOTYPE((char *fmt, ...));
+#else
+/*VARARGS*/
+int error KRB5_PROTOTYPE((char *, va_list));
+#endif
#define ga() (void) des_write(rem, "", 1)
+#ifdef HAVE_STDARG_H
+error(char *fmt, ...)
+#else
/*VARARGS1*/
-error(fmt, a1, a2, a3, a4, a5)
+error(fmt, va_alist)
char *fmt;
- int a1, a2, a3, a4, a5;
+ va_dcl
+#endif
{
+ va_list ap;
char buf[RCP_BUFSIZ], *cp = buf;
-
+
+#ifdef HAVE_STDARG_H
+ va_start(ap, fmt);
+#else
+ va_start(ap);
+#endif
+
errs++;
*cp++ = 1;
- (void) sprintf(cp, fmt, a1, a2, a3, a4, a5);
+ (void) vsprintf(cp, fmt, ap);
+ va_end(ap);
+
(void) des_write(rem, buf, strlen(buf));
if (iamremote == 0)
(void) write(2, buf+1, strlen(buf+1));