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, ...)
{
va_list ap;
mu_diag_init ();
va_start (ap, fmt);
mu_stream_printf (mu_strerr, "\033s<%d>", MU_LOG_DEBUG);
mu_stream_vprintf (mu_strerr, fmt, ap);
......@@ -515,6 +516,7 @@ mu_debug_log_begin (const char *fmt, ...)
{
va_list ap;
mu_diag_init ();
va_start (ap, fmt);
mu_stream_printf (mu_strerr, "\033s<%d>", MU_LOG_DEBUG);
mu_stream_vprintf (mu_strerr, fmt, ap);
......