#include <9pm/u.h>
#include <9pm/libc.h>

#define	SIZE	4096
extern	int	printcol;

int
snprint(char *buf, int len, char *fmt, ...)
{
	char *out;
	va_list arg;
	int scol;

	scol = printcol;
	va_start(arg, fmt);
	out = doprint(buf, buf+len, fmt, arg);
	va_end(arg);
	printcol = scol;
	return out-buf;
}
