#include "defs.h"
#include "globals.h"

int
__nothing()
{
	return 0;
}

int
__m_botch(s, filename, linenumber)
const char *s;
const char *filename;
int linenumber;
/*
 *  Simple botch routine - writes directly to stderr
 */
{
	static char linebuf[16];	/* Enough to contain a BIG linenumber! */
	
	/* Try to flush the trace file and unbuffer stderr */
	(void) fflush(_malloc_statsfile);
	(void) setvbuf(stderr, (char *) 0, _IONBF, 0);
	(void) sprintf(linebuf, "%d", linenumber);
	(void) fputs("assertion in file ", stderr);
	(void) fputs(filename, stderr);
	(void) fputs(", line ", stderr);
	(void) fputs(linebuf, stderr);
	(void) fputs(" botched: ", stderr);
	(void) fputs(s, stderr);
	(void) fputs("\n", stderr);
	/*
	 *  In case stderr is buffered and was written to before we tried to
	 *  unbuffer it
	 */
	(void) fflush(stderr);
	abort();
	/*NOTREACHED*/
	return 0;	/* Just to satisfy gcc (and possibly other ANSI C compilers) */
}
