gdm r6057 - in trunk: . common



Author: bcameron
Date: Tue Mar 25 02:55:14 2008
New Revision: 6057
URL: http://svn.gnome.org/viewvc/gdm?rev=6057&view=rev

Log:
2008-03-24  Brian Cameron  <brian cameron sun com>

        * common/gdm-profile.c: Fix NULL string issue in printf call.


Modified:
   trunk/ChangeLog
   trunk/common/gdm-profile.c

Modified: trunk/common/gdm-profile.c
==============================================================================
--- trunk/common/gdm-profile.c	(original)
+++ trunk/common/gdm-profile.c	Tue Mar 25 02:55:14 2008
@@ -43,6 +43,7 @@
         va_list args;
         char   *str;
         char   *formatted;
+        char   *prgname;
 
         if (format == NULL) {
                 formatted = g_strdup ("");
@@ -52,10 +53,19 @@
                 va_end (args);
         }
 
+        prgname = g_get_prgname();
+
         if (func != NULL) {
-                str = g_strdup_printf ("MARK: %s %s: %s %s", g_get_prgname(), func, note ? note : "", formatted);
+                str = g_strdup_printf ("MARK: %s %s: %s %s",
+                                       prgname ? prgname : "(null)",
+                                       func,
+                                       note ? note : "",
+                                       formatted);
         } else {
-                str = g_strdup_printf ("MARK: %s: %s %s", g_get_prgname(), note ? note : "", formatted);
+                str = g_strdup_printf ("MARK: %s: %s %s",
+                                       prgname ? prgname : "(null)",
+                                       note ? note : "",
+                                       formatted);
         }
 
         g_free (formatted);



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