ekiga r7244 - in branches/gnome-2-24: . lib/gui src/gui



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

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


Modified:
   branches/gnome-2-24/ChangeLog
   branches/gnome-2-24/NEWS
   branches/gnome-2-24/lib/gui/gmdialog.c
   branches/gnome-2-24/src/gui/main.cpp

Modified: branches/gnome-2-24/NEWS
==============================================================================
--- branches/gnome-2-24/NEWS	(original)
+++ branches/gnome-2-24/NEWS	Thu Oct 16 18:41:59 2008
@@ -1,4 +1,5 @@
 Changes since Ekiga 3.00
+- Fix crash on windows when using vsnprintf with a format string = NULL. Happend when clicking the statusline.
 - Fix crash on windows when the only available accelerated surface is already taken.
 - Fix playing of audio files with samplerate != 8000Hz on windows (#555832).
 - Fix overlapping issue of font/smiley buttons (#554529) (Jan Schampera)

Modified: branches/gnome-2-24/lib/gui/gmdialog.c
==============================================================================
--- branches/gnome-2-24/lib/gui/gmdialog.c	(original)
+++ branches/gnome-2-24/lib/gui/gmdialog.c	Thu Oct 16 18:41:59 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: branches/gnome-2-24/src/gui/main.cpp
==============================================================================
--- branches/gnome-2-24/src/gui/main.cpp	(original)
+++ branches/gnome-2-24/src/gui/main.cpp	Thu Oct 16 18:41:59 2008
@@ -4319,7 +4319,12 @@
   va_list args;
 
   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->statusbar), "%s", buffer);
   va_end (args);
 }
@@ -4341,7 +4346,12 @@
   va_list args;
 
   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->statusbar), "%s", buffer);
   va_end (args);
 }



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