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.
Showing
1 changed file
with
2 additions
and
0 deletions
... | @@ -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); | ... | ... |
-
Please register or sign in to post a comment