From 6c4c85bd28d77115622bf384a61768ee5358ab93 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Thu, 3 Jun 2004 17:54:24 +0000 Subject: don't use vsprintf with NULL strings, crashes on FreeBSD. 2004-06-03 Rodrigo Moya * gui/e-tasks.c (set_status_message): don't use vsprintf with NULL strings, crashes on FreeBSD. svn path=/trunk/; revision=26176 --- calendar/gui/e-tasks.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'calendar/gui') diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c index 947cf60a11..56d9709d12 100644 --- a/calendar/gui/e-tasks.c +++ b/calendar/gui/e-tasks.c @@ -679,15 +679,18 @@ set_status_message (ETasks *tasks, const char *message, ...) { ETasksPrivate *priv; va_list args; - char sz[2048]; - - va_start (args, message); - vsnprintf (sz, sizeof sz, message, args); - va_end (args); + char sz[2048], *msg_string = NULL; + + if (message) { + va_start (args, message); + vsnprintf (sz, sizeof sz, message, args); + va_end (args); + msg_string = sz; + } priv = tasks->priv; - e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->tasks_view), sz); + e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->tasks_view), msg_string); } /* Callback from the calendar client when an error occurs in the backend */ -- cgit