static char *RCSid = "$Header: sendclient.c,v 1.7 90/04/13 12:27:41 mr-frog Exp $";

/*
 * sendclient.c
 *
 * send and recieve commands
 *
 * Dave Pare, 1986
 */

#include "misc.h"
#include "proto.h"
#include "login.h"

#include <netinet/in.h>
#include <errno.h>
#include <varargs.h>

sendclient(va_alist)
	va_dcl
{
	va_list	list;
	char	buf[1024];
	iop_t	iop;
	int	val;
	char	*ptr;
	char	*fmt;

	va_start(list);
	iop = va_arg(list, iop_t);
	val = va_arg(list, int);
	fmt = va_arg(list, char *);
	(void) sprintf(buf, "%x", val);
	ptr = index(buf, '\0');
	if (fmt != 0) {
		*ptr++ = ' ';
		(void) vsprintf(ptr, fmt, list);
		ptr = index(ptr, '\0');
	}
	*ptr++ = '\n';
	*ptr = '\0';
	va_end(list);
	(void) io_puts(iop, buf);
}
