diff options
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -27,6 +27,7 @@ static const char ident[]="$Id$"; #include <stdio.h> #include <string.h> +#include <stdarg.h> #include "util.h" #include "exit.h" @@ -108,4 +109,20 @@ const char *Dirname(const char *path) } +void Debug(const char *format, ...) +{ + static FILE *fp=NULL; + va_list ap; + + if (!fp) + fp=fopen("debug.txt","w"); + + if (!fp) + return; + + va_start(ap,format); + vfprintf(fp,format,ap); + va_end(ap); +} + /* END OF FILE */ |