AUDIT: r17965 - gnucash/trunk/src/import-export/ofx - Bug #572107: Use fallback string for OFX account types when matching to GnuCash accounts.
Andreas Köhler
andi5 at cvs.gnucash.org
Thu Feb 26 17:12:51 EST 2009
Author: andi5
Date: 2009-02-26 17:12:51 -0500 (Thu, 26 Feb 2009)
New Revision: 17965
Trac: http://svn.gnucash.org/trac/changeset/17965
Modified:
gnucash/trunk/src/import-export/ofx/gnc-ofx-import.c
Log:
Bug #572107: Use fallback string for OFX account types when matching to GnuCash accounts.
Without the fallback, NULL is printf'ed which crashes GnuCash on
Windows.
BP
Modified: gnucash/trunk/src/import-export/ofx/gnc-ofx-import.c
===================================================================
--- gnucash/trunk/src/import-export/ofx/gnc-ofx-import.c 2009-02-25 20:03:48 UTC (rev 17964)
+++ gnucash/trunk/src/import-export/ofx/gnc-ofx-import.c 2009-02-26 22:12:51 UTC (rev 17965)
@@ -560,7 +560,7 @@
gnc_commodity * default_commodity;
GNCAccountType default_type=ACCT_TYPE_NONE;
gchar * account_description;
- gchar * account_type_name = NULL;
+ const gchar * account_type_name = _("Unknown OFX account");
if(data.account_id_valid==true){
commodity_table = gnc_get_current_commodities ();
@@ -580,31 +580,31 @@
switch(data.account_type){
case OFX_CHECKING :
default_type=ACCT_TYPE_BANK;
- account_type_name = g_strdup_printf(_("Unknown OFX checking account"));
+ account_type_name = _("Unknown OFX checking account");
break;
case OFX_SAVINGS :
default_type=ACCT_TYPE_BANK;
- account_type_name = g_strdup_printf(_("Unknown OFX savings account"));
+ account_type_name = _("Unknown OFX savings account");
break;
case OFX_MONEYMRKT :
default_type=ACCT_TYPE_MONEYMRKT;
- account_type_name = g_strdup_printf(_("Unknown OFX money market account"));
+ account_type_name = _("Unknown OFX money market account");
break;
case OFX_CREDITLINE :
default_type=ACCT_TYPE_CREDITLINE;
- account_type_name = g_strdup_printf(_("Unknown OFX credit line account"));
+ account_type_name = _("Unknown OFX credit line account");
break;
case OFX_CMA :
default_type=ACCT_TYPE_NONE;
- account_type_name = g_strdup_printf(_("Unknown OFX CMA account"));
+ account_type_name = _("Unknown OFX CMA account");
break;
case OFX_CREDITCARD :
default_type=ACCT_TYPE_CREDIT;
- account_type_name = g_strdup_printf(_("Unknown OFX credit card account"));
+ account_type_name = _("Unknown OFX credit card account");
break;
case OFX_INVESTMENT :
default_type=ACCT_TYPE_BANK;
- account_type_name = g_strdup_printf(_("Unknown OFX investment account"));
+ account_type_name = _("Unknown OFX investment account");
break;
default: PERR("WRITEME: ofx_proc_account() This is an unknown account type!");
}
@@ -623,7 +623,6 @@
account_description, default_commodity,
default_type, NULL, NULL);
g_free(account_description);
- g_free(account_type_name);
}
else
{
More information about the gnucash-changes
mailing list