Fixed arguments to debug function.
This commit is contained in:
18
src/util.c
18
src/util.c
@@ -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
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user