diff options
-rw-r--r-- | filter/ChangeLog | 4 | ||||
-rw-r--r-- | filter/filter-driver.c | 11 |
2 files changed, 13 insertions, 2 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog index ff710109bc..1e80d11b1e 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -1,3 +1,7 @@ +2022-10-24 Jeffrey Stedfast <fejj@helixcode.com> + + * filter-driver.c: Fixed NULL in fprintf. + 2000-10-24 Dan Winship <danw@helixcode.com> * Makefile.am (libfilter-i18n.h): Build a fake header file with diff --git a/filter/filter-driver.c b/filter/filter-driver.c index 9bff98fac4..369d3573e2 100644 --- a/filter/filter-driver.c +++ b/filter/filter-driver.c @@ -484,12 +484,19 @@ filter_driver_status_log (FilterDriver *driver, enum filter_status_t status, /* write log header */ time_t t; char date[50]; + char *from = NULL; + char *subject = NULL; + + if (msg) { + from = camel_mime_message_get_from(msg); + subject = camel_mime_message_get_subject(msg); + } time (&t); strftime (date, 49, "%a, %d %b %Y %H:%M:%S", localtime (&t)); fprintf (out, " - Applied filter \"%s\" to message from %s - \"%s\" at %s\n", - desc, msg ? camel_mime_message_get_from (msg) : "unknown", - msg ? camel_mime_message_get_subject (msg) : "", date); + desc, from ? from : "unknown", + subject ? subject : "", date); break; } case FILTER_STATUS_START: |