diff options
author | Brian Cameron <brian.cameron@sun.com> | 2008-03-25 02:55:14 +0000 |
---|---|---|
committer | Brian Cameron <bcameron@src.gnome.org> | 2008-03-25 02:55:14 +0000 |
commit | fd203c4a5af87c8920cef60e80512de1c7d23e3a (patch) | |
tree | 54321e21ea1b0f9d4293184b306b373ee05187c9 /common | |
parent | 52bdcb8e7ea02fe9ed171179c8e4bdcf285887a0 (diff) | |
download | gdm-fd203c4a5af87c8920cef60e80512de1c7d23e3a.tar.gz |
Fix NULL string issue in printf call.
2008-03-24 Brian Cameron <brian.cameron@sun.com>
* common/gdm-profile.c: Fix NULL string issue in printf call.
svn path=/trunk/; revision=6057
Diffstat (limited to 'common')
-rw-r--r-- | common/gdm-profile.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/common/gdm-profile.c b/common/gdm-profile.c index 0b71e3bb..27b29b02 100644 --- a/common/gdm-profile.c +++ b/common/gdm-profile.c @@ -43,6 +43,7 @@ _gdm_profile_log (const char *func, va_list args; char *str; char *formatted; + char *prgname; if (format == NULL) { formatted = g_strdup (""); @@ -52,10 +53,19 @@ _gdm_profile_log (const char *func, 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); |