A fatal-family function that can format its argument

This commit is contained in:
Jeff Epler 2013-11-30 10:19:32 -06:00
parent 2cf6867dce
commit 41643a1668

View file

@ -101,6 +101,18 @@ fatal(const char *s) {
fprintf(stderr, "%s\n", s); abort();
}
static void
fatalf(const char *fmt, ...) __attribute__((noreturn));
static void
fatalf(const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
fputc('\n', stderr);
abort();
}
static void
putle64(unsigned char *buf, uint64_t arg)
{