A fatal-family function that can format its argument
This commit is contained in:
parent
2cf6867dce
commit
41643a1668
1 changed files with 12 additions and 0 deletions
12
ungeli.c
12
ungeli.c
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue