Commit 0cf36c45 0cf36c45b0a1a8dada253bc7ab0c6ab6057e7d3e by Sergey Poznyakoff

Make sure debugging calls don't dump core even if mu_strerr is not initialized.

* libmailutils/diag/debug.c (mu_debug_log, mu_debug_log_begin): Call
mu_diag_init.
1 parent 426df179
...@@ -503,6 +503,7 @@ mu_debug_log (const char *fmt, ...) ...@@ -503,6 +503,7 @@ mu_debug_log (const char *fmt, ...)
503 { 503 {
504 va_list ap; 504 va_list ap;
505 505
506 mu_diag_init ();
506 va_start (ap, fmt); 507 va_start (ap, fmt);
507 mu_stream_printf (mu_strerr, "\033s<%d>", MU_LOG_DEBUG); 508 mu_stream_printf (mu_strerr, "\033s<%d>", MU_LOG_DEBUG);
508 mu_stream_vprintf (mu_strerr, fmt, ap); 509 mu_stream_vprintf (mu_strerr, fmt, ap);
...@@ -515,6 +516,7 @@ mu_debug_log_begin (const char *fmt, ...) ...@@ -515,6 +516,7 @@ mu_debug_log_begin (const char *fmt, ...)
515 { 516 {
516 va_list ap; 517 va_list ap;
517 518
519 mu_diag_init ();
518 va_start (ap, fmt); 520 va_start (ap, fmt);
519 mu_stream_printf (mu_strerr, "\033s<%d>", MU_LOG_DEBUG); 521 mu_stream_printf (mu_strerr, "\033s<%d>", MU_LOG_DEBUG);
520 mu_stream_vprintf (mu_strerr, fmt, ap); 522 mu_stream_vprintf (mu_strerr, fmt, ap);
......