scyther/src/error.c

21 lines
388 B
C
Raw Normal View History

2004-06-12 15:20:07 +01:00
#include <stdio.h>
#include <stdarg.h>
#include "error.h"
//! Print error message and die.
/**
* Adapted from [K&R2], p. 174
* Input is comparable to printf, only end of line is not required.
*/
void error (char *fmt, ...)
{
va_list args;
va_start (args, fmt);
fprintf (stderr, "error: ");
vprintf (stderr, fmt, args);
fprintf (stderr, "\n");
va_end (args);
exit(1);
}