From e99befc7bb02e6788a3db62545283e1ecf65c128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=B6hler?= Date: Wed, 18 Oct 2006 21:08:26 +0000 Subject: [PATCH] Correct gnc_gconf_add/remove_notification to avoid printf'ing NULL and therefore crashes on Solaris and Windows. r14675 had fixed that, r14945 (me) undermined it though. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15041 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/core-utils/gnc-gconf-utils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core-utils/gnc-gconf-utils.c b/src/core-utils/gnc-gconf-utils.c index 94281f4889..24d9a92e0f 100644 --- a/src/core-utils/gnc-gconf-utils.c +++ b/src/core-utils/gnc-gconf-utils.c @@ -787,8 +787,8 @@ gnc_gconf_add_notification (GObject *object, /* * Save the values needed to undo this later. */ - client_tag = g_strdup_printf(CLIENT_TAG, section, whoami); - notify_tag = g_strdup_printf(NOTIFY_TAG, section, whoami); + client_tag = g_strdup_printf(CLIENT_TAG, section ? section:"", whoami); + notify_tag = g_strdup_printf(NOTIFY_TAG, section ? section:"", whoami); g_object_set_data(object, client_tag, client); g_object_set_data(object, notify_tag, GUINT_TO_POINTER(id)); g_free(notify_tag); @@ -858,11 +858,11 @@ gnc_gconf_remove_notification (GObject *object, /* * Remove any gconf notifications */ - client_tag = g_strdup_printf(CLIENT_TAG, section, whoami); + client_tag = g_strdup_printf(CLIENT_TAG, section ? section:"", whoami); client = g_object_get_data(object, client_tag); path = gnc_gconf_section_name(section); if (client) { - notify_tag = g_strdup_printf(NOTIFY_TAG, section, whoami); + notify_tag = g_strdup_printf(NOTIFY_TAG, section ? section:"", whoami); id = GPOINTER_TO_UINT(g_object_get_data(object, notify_tag)); gconf_client_notify_remove(client, id); gconf_client_remove_dir(client, path, NULL);