ekiga r7254 - in trunk: . lib/gui src/gui



Author: mschneid
Date: Thu Oct 16 20:39:18 2008
New Revision: 7254
URL: http://svn.gnome.org/viewvc/ekiga?rev=7254&view=rev

Log:
Fix crash on windows when using vsnprintf with a
format string = NULL. Happend when clicking the
statusline.



Modified:
   trunk/ChangeLog
   trunk/lib/gui/gmdialog.c
   trunk/src/gui/main.cpp

Modified: trunk/lib/gui/gmdialog.c
==============================================================================
--- trunk/lib/gui/gmdialog.c	(original)
+++ trunk/lib/gui/gmdialog.c	Thu Oct 16 20:39:18 2008
@@ -399,8 +399,10 @@
   primary_text =
     g_strdup_printf ("<span weight=\"bold\" size=\"larger\">%s</span>",
 		     prim_text);
-  
-  vsnprintf (buffer, 1024, format, args);
+  if (format == NULL)
+    buffer[0] = 0;
+  else 
+    vsnprintf (buffer, 1024, format, args);
 
   dialog_text =
     g_strdup_printf ("%s\n\n%s", primary_text, buffer);
@@ -473,8 +475,12 @@
   button = 
     gtk_check_button_new_with_label (_("Do not show this dialog again"));
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), do_not_show);
+
   
-  vsnprintf (buffer, 1024, format, args);
+  if (format == NULL)
+    buffer[0] = 0;
+  else 
+    vsnprintf (buffer, 1024, format, args);
 
   prim_text =
     g_strdup_printf ("<span weight=\"bold\" size=\"larger\">%s</span>",
@@ -541,7 +547,10 @@
     g_strdup_printf ("<span weight=\"bold\" size=\"larger\">%s</span>",
 		     prim_text);
   
-  vsnprintf (buffer, 1024, format, args);
+  if (format == NULL)
+    buffer[0] = 0;
+  else 
+    vsnprintf (buffer, 1024, format, args);
 
   dialog_text =
     g_strdup_printf ("%s\n\n%s", primary_text, buffer);

Modified: trunk/src/gui/main.cpp
==============================================================================
--- trunk/src/gui/main.cpp	(original)
+++ trunk/src/gui/main.cpp	Thu Oct 16 20:39:18 2008
@@ -4082,7 +4082,12 @@
   g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
 
   va_start (args, msg);
-  vsnprintf (buffer, 1024, msg, args);
+
+  if (msg == NULL)
+    buffer[0] = 0;
+  else 
+    vsnprintf (buffer, 1024, msg, args);
+
   gm_statusbar_flash_message (GM_STATUSBAR (mw->priv->statusbar), "%s", buffer);
   va_end (args);
 }
@@ -4099,7 +4104,12 @@
   g_return_if_fail (EKIGA_IS_MAIN_WINDOW (mw));
 
   va_start (args, msg);
-  vsnprintf (buffer, 1024, msg, args);
+
+  if (msg == NULL)
+    buffer[0] = 0;
+  else 
+    vsnprintf (buffer, 1024, msg, args);
+
   gm_statusbar_push_message (GM_STATUSBAR (mw->priv->statusbar), "%s", buffer);
   va_end (args);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]