Skip to main content
gamedev.net
🔒 Locked

Log/Bug Function not Working

Started by Darobat 0 replies 500+ views
Original Post
Darobat
Darobat
void Bug(char *str, ...)
{
	va_list args;

	fprintf(gLog, "***BUG***: ");
	va_start(args, str);
		vfprintf(gLog, str, args);
	va_end(args);
	fputs("\r\n", gLog);
}


gLog is a global FILE* that has been opened. It compiles fine, and works if I have no arguments, but as soon as I try call the function with arguments, I get a memory error when the function is called and the program crashes. Anyone have any ideas why it isn't working? Thanks [Edited by - Darobat on September 23, 2006 11:16:22 PM]
--------------------C++ Home - Check it out!Lol... - Amazing video

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.