diff options
author | William Jon McCann <mccann@jhu.edu> | 2007-02-07 14:49:05 -0500 |
---|---|---|
committer | William Jon McCann <mccann@jhu.edu> | 2007-02-07 14:49:05 -0500 |
commit | 975ccd898da30b3904e287848d6d7661ed0a9dfe (patch) | |
tree | 0bfe9a5c3c808d9ce3ab3f7be6d514f2c336b772 | |
parent | 4cf47cb3072a7995e6dc87fcc7dd4bafe76256f8 (diff) |
reduce the debug buffer size
Reduce the buffer size in the debugging code.
-rw-r--r-- | src/ck-debug.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ck-debug.c b/src/ck-debug.c index 458b467..adf17d5 100644 --- a/src/ck-debug.c +++ b/src/ck-debug.c @@ -48,16 +48,17 @@ ck_debug_real (const char *func, const char *format, ...) { va_list args; - char buffer [1025]; + char buffer [256]; char *str_time; time_t the_time; + FILE *stream; if (debugging == FALSE) return; va_start (args, format); - g_vsnprintf (buffer, 1024, format, args); + g_vsnprintf (buffer, 255, format, args); va_end (args); @@ -65,13 +66,12 @@ ck_debug_real (const char *func, str_time = g_new0 (char, 255); strftime (str_time, 254, "%H:%M:%S", localtime (&the_time)); - fprintf ((debug_out ? debug_out : stderr), + stream = debug_out ? debug_out : stderr; + setbuf (stream, NULL); + fprintf (stream, "[%s] %s:%d (%s):\t %s\n", func, file, line, str_time, buffer); - if (debug_out) - fflush (debug_out); - g_free (str_time); } |