xref: /plan9/sys/src/cmd/auth/lib/error.c (revision f54edc786b9c49b2c7ab1c0695cdc8c698b11f4d)
1 #include <u.h>
2 #include <libc.h>
3 #include <bio.h>
4 #include "authcmdlib.h"
5 
6 void
error(char * fmt,...)7 error(char *fmt, ...)
8 {
9 	char buf[8192], *s;
10 	va_list arg;
11 
12 	s = buf;
13 	s += snprint(s, sizeof buf, "%s: ", argv0);
14 	va_start(arg, fmt);
15 	s = vseprint(s, buf + sizeof(buf), fmt, arg);
16 	va_end(arg);
17 	*s++ = '\n';
18 	write(2, buf, s - buf);
19 	exits(buf);
20 }
21