minix/lib/libddekit/src/panic.c
Ben Gras 2d2a1a077d panic: declare as printf-style-checked
. and related fixes

Change-Id: I5131ac57dc53d8aec8d421a34c5ceea383404d7a
2013-05-31 13:35:25 +00:00

34 lines
888 B
C

#include "common.h"
#include <ddekit/panic.h>
#include <ddekit/printf.h>
/****************************************************************************/
/* ddekit_panic */
/****************************************************************************/
void ddekit_panic(char *fmt, ...)
{
int r;
va_list va;
printf("%c[31;1mPANIC: \033[0m\n",0x1b);
va_start(va,fmt);
r = vprintf(fmt, va);
va_end(va);
panic("panicced");
while(1)
;
}
/****************************************************************************/
/* ddekit_debug */
/****************************************************************************/
void ddekit_debug(char *fmt, ...)
{
int r;
va_list va;
va_start(va,fmt);
r = vprintf(fmt, va);
va_end(va);
}