Fixed arguments to debug function.

This commit is contained in:
Matthew Bloch
2012-06-07 01:15:29 +01:00
parent 8cf1a515dd
commit 9fc3c061f8

View File

@@ -66,17 +66,21 @@ void set_debug(int value) {
} }
#ifdef DEBUG #ifdef DEBUG
# include <sys/times.h> # include <sys/times.h>
# include <stdarg.h> # include <stdarg.h>
void debug(const char *msg, ...) { void debug(const char *format, ...) {
va_list argp; va_list argptr;
if ( global_debug ) { if (!global_debug)
fprintf(stderr, "%08x %4d: ", (int) pthread_self(), (int) clock() ); return;
fprintf(stderr, msg, argp);
fprintf(stderr, "\n"); fprintf(stderr, "%08x %4d: ", (int) pthread_self(), (int) clock() );
} va_start(argptr, format);
vfprintf(stderr, format, argptr);
va_end(argptr);
fprintf(stderr, "\n");
} }
#endif #endif