From 6627ae75ab2c6cf8ddbec92f95bf836c8b69c283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=B6hler?= Date: Mon, 16 Apr 2007 08:26:18 +0000 Subject: [PATCH] Fix NULL-%s-printf in gnc_import_select_account. Fixes #430130. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15909 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/import-export/import-account-matcher.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/import-export/import-account-matcher.c b/src/import-export/import-account-matcher.c index cfeaf18b85..0fcc829de5 100644 --- a/src/import-export/import-account-matcher.c +++ b/src/import-export/import-account-matcher.c @@ -152,6 +152,7 @@ Account * gnc_import_select_account(gncUIWidget parent, struct _accountpickerdialog * picker; gint response; Account * retval = NULL; + const gchar *retval_name = NULL; GladeXML *xml; GtkWidget * online_id_label, *button; gchar account_description_text[ACCOUNT_DESCRIPTION_MAX_SIZE] = ""; @@ -225,7 +226,9 @@ Account * gnc_import_select_account(gncUIWidget parent, switch (response) { case GTK_RESPONSE_OK: retval = gnc_tree_view_account_get_selected_account(picker->account_tree); - DEBUG("Selected account %p, %s", retval, xaccAccountGetName(retval)); + retval_name = xaccAccountGetName(retval); + DEBUG("Selected account %p, %s", retval, + retval_name ? retval_name : "(null)"); /* See if the selected account is a placeholder. */ if (xaccAccountGetPlaceholder (retval)) { @@ -233,7 +236,7 @@ Account * gnc_import_select_account(gncUIWidget parent, (picker->dialog, _("The account %s is a placeholder account and does not allow " "transactions. Please choose a different account."), - xaccAccountGetName (retval)); + retval_name ? retval_name : "(null)"); response = GNC_RESPONSE_NEW; break; } @@ -256,6 +259,7 @@ Account * gnc_import_select_account(gncUIWidget parent, } else { + retval_name = xaccAccountGetName(retval); ok_pressed_retval=TRUE; /* There was no dialog involved, so the computer "pressed" ok */ } /*FIXME: DEBUG("WRITEME: gnc_import_select_account() Here we should check if account type is compatible, currency matches, etc.\n"); */ @@ -265,7 +269,7 @@ Account * gnc_import_select_account(gncUIWidget parent, { *ok_pressed=ok_pressed_retval; } - LEAVE("Selected account %p, %s", retval, xaccAccountGetName(retval)); + LEAVE("Selected account %p, %s", retval, retval_name ? retval_name : "(null)"); return retval; } /**@}*/