From fead1da0b773c351ce34c4e62ecbdf6b568c6f5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=B6hler?= Date: Fri, 4 Jul 2008 00:42:00 +0000 Subject: [PATCH] Fix -Wformat gcc warnings. BP git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17254 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/app-utils/gfec.c | 2 +- src/backend/file/io-utils.c | 2 +- src/bin/gnucash-bin.c | 2 +- src/business/business-gnome/dialog-billterms.c | 6 +++--- src/business/business-gnome/dialog-customer.c | 2 +- src/business/business-gnome/dialog-employee.c | 2 +- src/business/business-gnome/dialog-invoice.c | 2 +- src/business/business-gnome/dialog-job.c | 4 ++-- src/business/business-gnome/dialog-order.c | 2 +- src/business/business-gnome/dialog-payment.c | 8 ++++---- src/business/business-gnome/dialog-vendor.c | 2 +- .../business-ledger/gncEntryLedgerControl.c | 2 +- .../dialog-tax-table/dialog-tax-table.c | 10 +++++----- src/gnome-search/dialog-search.c | 2 +- src/gnome-utils/dialog-account.c | 18 +++++++++--------- src/gnome-utils/dialog-transfer.c | 8 ++++---- src/gnome-utils/druid-gconf-setup.c | 6 +++--- src/gnome-utils/druid-gnc-xml-import.c | 10 +++++----- src/gnome-utils/gnc-file.c | 10 +++++----- src/gnome-utils/gnc-gnome-utils.c | 2 +- src/gnome-utils/gnc-html.c | 2 +- src/gnome/dialog-commodities.c | 2 +- src/gnome/dialog-fincalc.c | 2 +- src/gnome/dialog-price-editor.c | 2 +- src/gnome/dialog-print-check.c | 2 +- src/gnome/dialog-sx-editor.c | 17 +++++++++-------- src/gnome/druid-acct-period.c | 4 ++-- src/gnome/druid-loan.c | 2 +- src/gnome/druid-merge.c | 4 ++-- src/gnome/druid-stock-split.c | 10 +++++----- src/gnome/gnc-plugin-basic-commands.c | 4 ++-- src/gnome/gnc-split-reg.c | 2 +- src/gnome/window-reconcile.c | 8 ++++---- src/import-export/hbci/hbci-interaction.c | 8 ++++---- src/import-export/log-replay/gnc-log-replay.c | 2 +- .../ledger-core/split-register-control.c | 4 ++-- src/register/ledger-core/split-register.c | 4 ++-- .../report-gnome/gnc-plugin-page-report.c | 2 +- 38 files changed, 92 insertions(+), 91 deletions(-) diff --git a/src/app-utils/gfec.c b/src/app-utils/gfec.c index 7f066cff813..e9c00f01764 100644 --- a/src/app-utils/gfec.c +++ b/src/app-utils/gfec.c @@ -169,7 +169,7 @@ static int error_in_scm_eval = FALSE; static void error_handler(const char *msg) { - g_warning(msg); + g_warning("%s", msg); error_in_scm_eval = TRUE; } diff --git a/src/backend/file/io-utils.c b/src/backend/file/io-utils.c index fc595666e97..a725abc2d07 100644 --- a/src/backend/file/io-utils.c +++ b/src/backend/file/io-utils.c @@ -48,7 +48,7 @@ static const gchar *emacs_trailer = void write_emacs_trailer(FILE *out) { - fprintf(out, emacs_trailer); + fprintf(out, "%s", emacs_trailer); } static void diff --git a/src/bin/gnucash-bin.c b/src/bin/gnucash-bin.c index e54ea15a952..c76df396821 100644 --- a/src/bin/gnucash-bin.c +++ b/src/bin/gnucash-bin.c @@ -141,7 +141,7 @@ static void update_message(const gchar *msg) { gnc_update_splash_screen(msg, GNC_SPLASH_PERCENTAGE_UNKNOWN); - g_message(msg); + g_message("%s", msg); } static void diff --git a/src/business/business-gnome/dialog-billterms.c b/src/business/business-gnome/dialog-billterms.c index 5521aee8866..49046d54513 100644 --- a/src/business/business-gnome/dialog-billterms.c +++ b/src/business/business-gnome/dialog-billterms.c @@ -260,12 +260,12 @@ verify_term_ok (NewBillTerm *nbt) num = gnc_numeric_zero (); if (gnc_numeric_negative_p (num)) { message = _("Negative amounts are not allowed."); - gnc_error_dialog (nbt->dialog, message); + gnc_error_dialog (nbt->dialog, "%s", message); return FALSE; } if (gnc_numeric_compare (num, gnc_numeric_create (100, 1)) > 0) { message = _("Percentage amount must be between 0 and 100."); - gnc_error_dialog (nbt->dialog, message); + gnc_error_dialog (nbt->dialog, "%s", message); return FALSE; } return TRUE; @@ -288,7 +288,7 @@ new_billterm_ok_cb (NewBillTerm *nbt) name = gtk_entry_get_text (GTK_ENTRY (nbt->name_entry)); if (name == NULL || *name == '\0') { message = _("You must provide a name for this Billing Term."); - gnc_error_dialog (nbt->dialog, message); + gnc_error_dialog (nbt->dialog, "%s", message); return FALSE; } if (gncBillTermLookupByName (btw->book, name)) { diff --git a/src/business/business-gnome/dialog-customer.c b/src/business/business-gnome/dialog-customer.c index 1130e3fc915..17737c7dfcc 100644 --- a/src/business/business-gnome/dialog-customer.c +++ b/src/business/business-gnome/dialog-customer.c @@ -277,7 +277,7 @@ gnc_customer_window_ok_cb (GtkWidget *widget, gpointer data) check_entry_nonempty (cw->dialog, cw->addr3_entry, NULL) && check_entry_nonempty (cw->dialog, cw->addr4_entry, NULL)) { const char *msg = _("You must enter a billing address."); - gnc_error_dialog (cw->dialog, msg); + gnc_error_dialog (cw->dialog, "%s", msg); return; } diff --git a/src/business/business-gnome/dialog-employee.c b/src/business/business-gnome/dialog-employee.c index 198f3b2461a..7e9de617071 100644 --- a/src/business/business-gnome/dialog-employee.c +++ b/src/business/business-gnome/dialog-employee.c @@ -227,7 +227,7 @@ gnc_employee_window_ok_cb (GtkWidget *widget, gpointer data) check_entry_nonempty (ew->dialog, ew->addr3_entry, NULL) && check_entry_nonempty (ew->dialog, ew->addr4_entry, NULL)) { const char *msg = _("You must enter an address."); - gnc_error_dialog (ew->dialog, msg); + gnc_error_dialog (ew->dialog, "%s", msg); return; } diff --git a/src/business/business-gnome/dialog-invoice.c b/src/business/business-gnome/dialog-invoice.c index ba3daa9886d..a681d59d805 100644 --- a/src/business/business-gnome/dialog-invoice.c +++ b/src/business/business-gnome/dialog-invoice.c @@ -519,7 +519,7 @@ gnc_invoice_window_deleteCB (GtkWidget *widget, gpointer data) else msg = g_strdup (message); - result = gnc_verify_dialog (iw_get_window(iw), FALSE, msg); + result = gnc_verify_dialog (iw_get_window(iw), FALSE, "%s", msg); g_free (msg); if (!result) diff --git a/src/business/business-gnome/dialog-job.c b/src/business/business-gnome/dialog-job.c index 2adecf53e70..355b81d48ec 100644 --- a/src/business/business-gnome/dialog-job.c +++ b/src/business/business-gnome/dialog-job.c @@ -128,7 +128,7 @@ gnc_job_verify_ok (JobWindow *jw) res = gtk_entry_get_text (GTK_ENTRY (jw->name_entry)); if (safe_strcmp (res, "") == 0) { const char *message = _("The Job must be given a name."); - gnc_error_dialog(jw->dialog, message); + gnc_error_dialog(jw->dialog, "%s", message); return FALSE; } @@ -137,7 +137,7 @@ gnc_job_verify_ok (JobWindow *jw) res = gncOwnerGetName (&(jw->owner)); if (res == NULL || safe_strcmp (res, "") == 0) { const char *message = _("You must choose an owner for this job."); - gnc_error_dialog(jw->dialog, message); + gnc_error_dialog(jw->dialog, "%s", message); return FALSE; } diff --git a/src/business/business-gnome/dialog-order.c b/src/business/business-gnome/dialog-order.c index aec423f8a0a..c0a46dbe829 100644 --- a/src/business/business-gnome/dialog-order.c +++ b/src/business/business-gnome/dialog-order.c @@ -288,7 +288,7 @@ gnc_order_window_close_order_cb (GtkWidget *widget, gpointer data) "Are you sure you want to close it out before " "you invoice all the entries?"); - if (gnc_verify_dialog (ow->dialog, FALSE, message) == FALSE) + if (gnc_verify_dialog (ow->dialog, FALSE, "%s", message) == FALSE) return; } diff --git a/src/business/business-gnome/dialog-payment.c b/src/business/business-gnome/dialog-payment.c index 1013269a1c0..ea815a1450f 100644 --- a/src/business/business-gnome/dialog-payment.c +++ b/src/business/business-gnome/dialog-payment.c @@ -227,7 +227,7 @@ gnc_payment_ok_cb (GtkWidget *widget, gpointer data) if (gnc_numeric_check (amount) || !gnc_numeric_positive_p (amount)) { text = _("You must enter the amount of the payment. " "The payment amount must be greater than zero."); - gnc_error_dialog (pw->dialog, text); + gnc_error_dialog (pw->dialog, "%s", text); return; } @@ -235,7 +235,7 @@ gnc_payment_ok_cb (GtkWidget *widget, gpointer data) gnc_owner_get_owner (pw->owner_choice, &(pw->owner)); if (pw->owner.owner.undefined == NULL) { text = _("You must select a company for payment processing."); - gnc_error_dialog (pw->dialog, text); + gnc_error_dialog (pw->dialog, "%s", text); return; } @@ -243,7 +243,7 @@ gnc_payment_ok_cb (GtkWidget *widget, gpointer data) acc = gnc_tree_view_account_get_selected_account (GNC_TREE_VIEW_ACCOUNT(pw->acct_tree)); if (!acc) { text = _("You must select a transfer account from the account tree."); - gnc_error_dialog (pw->dialog, text); + gnc_error_dialog (pw->dialog, "%s", text); return; } @@ -251,7 +251,7 @@ gnc_payment_ok_cb (GtkWidget *widget, gpointer data) text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(pw->post_combo)); if (!text || safe_strcmp (text, "") == 0) { text = _("You must enter an account name for posting."); - gnc_error_dialog (pw->dialog, text); + gnc_error_dialog (pw->dialog, "%s", text); return; } diff --git a/src/business/business-gnome/dialog-vendor.c b/src/business/business-gnome/dialog-vendor.c index d341b19dd3c..365bfef3060 100644 --- a/src/business/business-gnome/dialog-vendor.c +++ b/src/business/business-gnome/dialog-vendor.c @@ -214,7 +214,7 @@ gnc_vendor_window_ok_cb (GtkWidget *widget, gpointer data) check_entry_nonempty (vw->dialog, vw->addr3_entry, NULL) && check_entry_nonempty (vw->dialog, vw->addr4_entry, NULL)) { const char *msg = _("You must enter a payment address."); - gnc_error_dialog (vw->dialog, msg); + gnc_error_dialog (vw->dialog, "%s", msg); return; } diff --git a/src/business/business-ledger/gncEntryLedgerControl.c b/src/business/business-ledger/gncEntryLedgerControl.c index 9949ede35c7..09c12e592f6 100644 --- a/src/business/business-ledger/gncEntryLedgerControl.c +++ b/src/business/business-ledger/gncEntryLedgerControl.c @@ -599,7 +599,7 @@ gnc_entry_ledger_check_close_internal (GtkWidget *parent, if (!gnc_entry_ledger_verify_can_save (ledger)) return FALSE; - if (dontask || gnc_verify_dialog (parent, TRUE, message)) + if (dontask || gnc_verify_dialog (parent, TRUE, "%s", message)) gnc_entry_ledger_save (ledger, TRUE); else gnc_entry_ledger_cancel_cursor_changes (ledger); diff --git a/src/business/dialog-tax-table/dialog-tax-table.c b/src/business/dialog-tax-table/dialog-tax-table.c index eff8f66f2d5..a420aa85d59 100644 --- a/src/business/dialog-tax-table/dialog-tax-table.c +++ b/src/business/dialog-tax-table/dialog-tax-table.c @@ -110,7 +110,7 @@ new_tax_table_ok_cb (NewTaxTable *ntt) name = gtk_entry_get_text (GTK_ENTRY (ntt->name_entry)); if (name == NULL || *name == '\0') { message = _("You must provide a name for this Tax Table."); - gnc_error_dialog (ntt->dialog, message); + gnc_error_dialog (ntt->dialog, "%s", message); return FALSE; } if (gncTaxTableLookupByName (ttw->book, name)) { @@ -127,14 +127,14 @@ new_tax_table_ok_cb (NewTaxTable *ntt) amount = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (ntt->amount_entry)); if (gnc_numeric_negative_p (amount)) { message = _("Negative amounts are not allowed."); - gnc_error_dialog (ntt->dialog, message); + gnc_error_dialog (ntt->dialog, "%s", message); return FALSE; } if (ntt->type == GNC_AMT_TYPE_PERCENT && gnc_numeric_compare (amount, gnc_numeric_create (100, 1)) > 0) { message = _("Percentage amount must be between 0 and 100."); - gnc_error_dialog (ntt->dialog, message); + gnc_error_dialog (ntt->dialog, "%s", message); return FALSE; } @@ -142,7 +142,7 @@ new_tax_table_ok_cb (NewTaxTable *ntt) acc = gnc_tree_view_account_get_selected_account (GNC_TREE_VIEW_ACCOUNT(ntt->acct_tree)); if (acc == NULL) { message = _("You must choose a Tax Account."); - gnc_error_dialog (ntt->dialog, message); + gnc_error_dialog (ntt->dialog, "%s", message); return FALSE; } @@ -579,7 +579,7 @@ tax_table_delete_entry_cb (GtkButton *button, TaxTableWindow *ttw) if (g_list_length (gncTaxTableGetEntries (ttw->current_table)) <= 1) { char *message = _("You cannot remove the last entry from the tax table. " "Try deleting the tax table if you want to do that."); - gnc_error_dialog (ttw->dialog, message); + gnc_error_dialog (ttw->dialog, "%s", message); return; } diff --git a/src/gnome-search/dialog-search.c b/src/gnome-search/dialog-search.c index cba43a9d0f3..4b8cb9a543d 100644 --- a/src/gnome-search/dialog-search.c +++ b/src/gnome-search/dialog-search.c @@ -153,7 +153,7 @@ gnc_search_dialog_select_cb (GtkButton *button, GNCSearchWindow *sw) if (sw->selected_item == NULL && sw->allow_clear == FALSE) { char *msg = _("You must select an item from the list"); - gnc_error_dialog (sw->dialog, msg); + gnc_error_dialog (sw->dialog, "%s", msg); return; } diff --git a/src/gnome-utils/dialog-account.c b/src/gnome-utils/dialog-account.c index 03b89ead513..299aaaa4334 100644 --- a/src/gnome-utils/dialog-account.c +++ b/src/gnome-utils/dialog-account.c @@ -415,7 +415,7 @@ gnc_ui_to_account(AccountWindow *aw) if (!gnc_account_create_opening_balance (account, balance, date, aw->book)) { const char *message = _("Could not create opening balance."); - gnc_error_dialog(aw->dialog, message); + gnc_error_dialog(aw->dialog, "%s", message); } } else @@ -707,7 +707,7 @@ gnc_common_ok (AccountWindow *aw) name = gtk_entry_get_text(GTK_ENTRY(aw->name_entry)); if (safe_strcmp(name, "") == 0) { const char *message = _("The account must be given a name."); - gnc_error_dialog(aw->dialog, message); + gnc_error_dialog(aw->dialog, "%s", message); LEAVE("bad name"); return FALSE; } @@ -729,7 +729,7 @@ gnc_common_ok (AccountWindow *aw) if ((account != NULL) && !guid_equal(&aw->account, xaccAccountGetGUID (account))) { const char *message = _("There is already an account with that name."); - gnc_error_dialog(aw->dialog, message); + gnc_error_dialog(aw->dialog, "%s", message); LEAVE("duplicate name"); return FALSE; } @@ -737,7 +737,7 @@ gnc_common_ok (AccountWindow *aw) /* Parent check, probably not needed, but be safe */ if (!gnc_filter_parent_accounts(parent, aw)) { const char *message = _("You must choose a valid parent account."); - gnc_error_dialog(aw->dialog, message); + gnc_error_dialog(aw->dialog, "%s", message); LEAVE("invalid parent"); return FALSE; } @@ -745,7 +745,7 @@ gnc_common_ok (AccountWindow *aw) /* check for valid type */ if (aw->type == ACCT_TYPE_INVALID) { const char *message = _("You must select an account type."); - gnc_error_dialog(aw->dialog, message); + gnc_error_dialog(aw->dialog, "%s", message); LEAVE("invalid type"); return FALSE; } @@ -754,7 +754,7 @@ gnc_common_ok (AccountWindow *aw) if (!xaccAccountTypesCompatible (aw->type, xaccAccountGetType (parent))) { const char *message = _("The selected account type is incompatible with " "the one of the selected parent."); - gnc_error_dialog(aw->dialog, message); + gnc_error_dialog(aw->dialog, "%s", message); LEAVE("incompatible types"); return FALSE; } @@ -764,7 +764,7 @@ gnc_common_ok (AccountWindow *aw) gnc_general_select_get_selected (GNC_GENERAL_SELECT (aw->commodity_edit)); if (!commodity) { const char *message = _("You must choose a commodity."); - gnc_error_dialog(aw->dialog, message); + gnc_error_dialog(aw->dialog, "%s", message); LEAVE("invalid commodity"); return FALSE; } @@ -817,7 +817,7 @@ gnc_new_account_ok (AccountWindow *aw) { const char *message = _("You must enter a valid opening balance " "or leave it blank."); - gnc_error_dialog(aw->dialog, message); + gnc_error_dialog(aw->dialog, "%s", message); LEAVE(" "); return; } @@ -841,7 +841,7 @@ gnc_new_account_ok (AccountWindow *aw) { const char *message = _("You must select a transfer account or choose" " the opening balances equity account."); - gnc_error_dialog(aw->dialog, message); + gnc_error_dialog(aw->dialog, "%s", message); LEAVE(" "); return; } diff --git a/src/gnome-utils/dialog-transfer.c b/src/gnome-utils/dialog-transfer.c index 72c6bc35da0..f24f2eb6d0e 100644 --- a/src/gnome-utils/dialog-transfer.c +++ b/src/gnome-utils/dialog-transfer.c @@ -1252,7 +1252,7 @@ gnc_xfer_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data) const char *message = _("You must specify an account to transfer from, " "or to, or both, for this transaction. " "Otherwise, it will not be recorded."); - gnc_error_dialog(xferData->dialog, message); + gnc_error_dialog(xferData->dialog, "%s", message); LEAVE("bad account"); return; } @@ -1261,7 +1261,7 @@ gnc_xfer_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data) { const char *message = _("You can't transfer from and to the same " "account!"); - gnc_error_dialog(xferData->dialog, message); + gnc_error_dialog(xferData->dialog, "%s", message); LEAVE("same account"); return; } @@ -1288,7 +1288,7 @@ gnc_xfer_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data) const char *message = _("You can't transfer from a non-currency account. " "Try reversing the \"from\" and \"to\" accounts " "and making the \"amount\" negative."); - gnc_error_dialog(xferData->dialog, message); + gnc_error_dialog(xferData->dialog, "%s", message); LEAVE("non-currency"); return; } @@ -1311,7 +1311,7 @@ gnc_xfer_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data) if (gnc_numeric_zero_p (amount)) { const char *message = _("You must enter an amount to transfer."); - gnc_error_dialog(xferData->dialog, message); + gnc_error_dialog(xferData->dialog, "%s", message); LEAVE("invalid from amount"); return; } diff --git a/src/gnome-utils/druid-gconf-setup.c b/src/gnome-utils/druid-gconf-setup.c index a317fd85369..1002987e568 100644 --- a/src/gnome-utils/druid-gconf-setup.c +++ b/src/gnome-utils/druid-gconf-setup.c @@ -505,7 +505,7 @@ druid_gconf_finish_page_finish (GnomeDruidPage *druidpage, case HOW_INSTALL: if (!druid_gconf_install_keys(&error)) { keep_going = FALSE; - gnc_error_dialog(NULL, error->message); + gnc_error_dialog(NULL, "%s", error->message); g_error_free(error); } break; @@ -513,7 +513,7 @@ druid_gconf_finish_page_finish (GnomeDruidPage *druidpage, default: if (!druid_gconf_update_path(&error)) { keep_going = FALSE; - gnc_error_dialog(NULL, error->message); + gnc_error_dialog(NULL, "%s", error->message); g_error_free(error); } break; @@ -587,7 +587,7 @@ gnc_gnome_install_gconf_schemas (void) /* Kill the backend daemon. When it restarts it will find our changes */ if (!g_spawn_command_line_sync("gconftool-2 --shutdown", NULL, NULL, NULL, &error)) { - gnc_warning_dialog(NULL, error->message); + gnc_warning_dialog(NULL, "%s", error->message); g_error_free(error); } } diff --git a/src/gnome-utils/druid-gnc-xml-import.c b/src/gnome-utils/druid-gnc-xml-import.c index a2175c71bd2..a24792bfd04 100644 --- a/src/gnome-utils/druid-gnc-xml-import.c +++ b/src/gnome-utils/druid-gnc-xml-import.c @@ -738,7 +738,7 @@ gxi_parse_file (GncXmlImportData *data) data->subst = NULL; } if (message) { - gnc_error_dialog (data->dialog, message); + gnc_error_dialog (data->dialog, "%s", message); } if (!success) gxi_session_destroy (data); @@ -1033,7 +1033,7 @@ gxi_load_file (GncXmlImportData *data) (GCompareFunc) file_filename_cmp)) { const gchar *message = _( "That GnuCash XML file is already loaded. Please select another file."); - gnc_error_dialog (data->dialog, message); + gnc_error_dialog (data->dialog, "%s", message); g_free (filename); return; } @@ -1335,7 +1335,7 @@ gxi_add_encoding (GncXmlImportData *data, gpointer encoding_ptr) if (g_list_find (data->encodings, encoding_ptr)) { message = _("This encoding has been added to the list already."); - gnc_error_dialog (data->encodings_dialog, message); + gnc_error_dialog (data->encodings_dialog, "%s", message); return; } @@ -1345,7 +1345,7 @@ gxi_add_encoding (GncXmlImportData *data, gpointer encoding_ptr) g_iconv_close (iconv); g_free (enc_string); message = _("This is an invalid encoding."); - gnc_error_dialog (data->encodings_dialog, message); + gnc_error_dialog (data->encodings_dialog, "%s", message); return; } g_iconv_close (iconv); @@ -1480,7 +1480,7 @@ gxi_loaded_files_next_cb (GnomeDruidPage *page, GtkWidget *widget, if (!g_list_first (data->files)) { const gchar *message = _( "No files to merge. Please add ones by clicking on 'Load another file'."); - gnc_error_dialog (data->dialog, message); + gnc_error_dialog (data->dialog, "%s", message); return TRUE; } diff --git a/src/gnome-utils/gnc-file.c b/src/gnome-utils/gnc-file.c index 649faa52821..754b5533063 100644 --- a/src/gnome-utils/gnc-file.c +++ b/src/gnome-utils/gnc-file.c @@ -230,7 +230,7 @@ show_session_error (QofBackendError io_error, fmt = _("This file/URL appears to be from a newer version " "of GnuCash. You must upgrade your version of GnuCash " "to work with this data."); - gnc_error_dialog (parent, fmt); + gnc_error_dialog (parent, "%s", fmt); break; case ERR_BACKEND_NO_SUCH_DB: @@ -395,7 +395,7 @@ show_session_error (QofBackendError io_error, case ERR_FILEIO_FILE_BAD_READ: fmt = _("There was an error reading the file. " "Do you want to continue?"); - if (gnc_verify_dialog (parent, TRUE, fmt)) { uh_oh = FALSE; } + if (gnc_verify_dialog (parent, TRUE, "%s", fmt)) { uh_oh = FALSE; } break; case ERR_FILEIO_PARSE_ERROR: @@ -420,7 +420,7 @@ show_session_error (QofBackendError io_error, case ERR_FILEIO_FILE_TOO_OLD: fmt = _("This file is from an older version of GnuCash. " "Do you want to continue?"); - if (gnc_verify_dialog (parent, TRUE, fmt)) { uh_oh = FALSE; } + if (gnc_verify_dialog (parent, TRUE, "%s", fmt)) { uh_oh = FALSE; } break; case ERR_FILEIO_UNKNOWN_FILE_TYPE: @@ -449,7 +449,7 @@ show_session_error (QofBackendError io_error, fmt = _("This database is from an older version of GnuCash. " "Do you want to want to upgrade the database " "to the current version?"); - if (gnc_verify_dialog (parent, TRUE, fmt)) { uh_oh = FALSE; } + if (gnc_verify_dialog (parent, TRUE, "%s", fmt)) { uh_oh = FALSE; } break; case ERR_SQL_DB_BUSY: @@ -458,7 +458,7 @@ show_session_error (QofBackendError io_error, "If there are currently no other users, consult the " "documentation to learn how to clear out dangling login " "sessions."); - gnc_error_dialog (parent, fmt); + gnc_error_dialog (parent, "%s", fmt); break; default: diff --git a/src/gnome-utils/gnc-gnome-utils.c b/src/gnome-utils/gnc-gnome-utils.c index 8ff4608f7c1..067217585d6 100644 --- a/src/gnome-utils/gnc-gnome-utils.c +++ b/src/gnome-utils/gnc-gnome-utils.c @@ -279,7 +279,7 @@ gnc_gnome_help (const char *file_name, const char *anchor) const gchar *message = _("GnuCash could not find the files for the help documentation. " "This is likely because the 'gnucash-docs' package is not installed."); - gnc_error_dialog(NULL, message); + gnc_error_dialog(NULL, "%s", message); } PERR ("%s", error->message); g_error_free(error); diff --git a/src/gnome-utils/gnc-html.c b/src/gnome-utils/gnc-html.c index 658890fc5cd..c5cf5376412 100644 --- a/src/gnome-utils/gnc-html.c +++ b/src/gnome-utils/gnc-html.c @@ -898,7 +898,7 @@ gnc_html_show_url(gnc_html * html, URLType type, if (!ok) { if (result.error_message) - gnc_error_dialog( html->window, result.error_message); + gnc_error_dialog( html->window, "%s", result.error_message); else /* %s is a URL (some location somewhere). */ gnc_error_dialog( html->window, _("There was an error accessing %s."), location); diff --git a/src/gnome/dialog-commodities.c b/src/gnome/dialog-commodities.c index dbafe84343d..6d10341249b 100644 --- a/src/gnome/dialog-commodities.c +++ b/src/gnome/dialog-commodities.c @@ -136,7 +136,7 @@ remove_clicked (CommoditiesDialog *cd) "at least one of your accounts. You may " "not delete it."); - gnc_warning_dialog (cd->dialog, message); + gnc_warning_dialog (cd->dialog, "%s", message); g_list_free (accounts); return; } diff --git a/src/gnome/dialog-fincalc.c b/src/gnome/dialog-fincalc.c index 02360885bd7..8b01fe58fb5 100644 --- a/src/gnome/dialog-fincalc.c +++ b/src/gnome/dialog-fincalc.c @@ -394,7 +394,7 @@ calc_value(FinCalcDialog *fcd, FinCalcValue value) { GtkWidget *entry; - gnc_error_dialog(fcd->dialog, string); + gnc_error_dialog(fcd->dialog, "%s", string); if (error_item == 0) entry = fcd->amounts[0]; else diff --git a/src/gnome/dialog-price-editor.c b/src/gnome/dialog-price-editor.c index 7eaec854f06..a14f39deec8 100644 --- a/src/gnome/dialog-price-editor.c +++ b/src/gnome/dialog-price-editor.c @@ -230,7 +230,7 @@ pedit_dialog_response_cb (GtkDialog *dialog, gint response, gpointer data) if (response == GTK_RESPONSE_OK) { error_str = gui_to_price (pedit_dialog); if (error_str) { - gnc_warning_dialog (pedit_dialog->dialog, error_str); + gnc_warning_dialog (pedit_dialog->dialog, "%s", error_str); return; } diff --git a/src/gnome/dialog-print-check.c b/src/gnome/dialog-print-check.c index 3d1e6a3d7dd..6e5388e0c16 100644 --- a/src/gnome/dialog-print-check.c +++ b/src/gnome/dialog-print-check.c @@ -550,7 +550,7 @@ pcd_save_custom_data(PrintCheckDialog *pcd, const gchar *title) GTK_BUTTONS_CLOSE, _("Cannot save check format file.")); gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), - error->message); + "%s", error->message); gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); g_error_free(error); diff --git a/src/gnome/dialog-sx-editor.c b/src/gnome/dialog-sx-editor.c index c43ff0053fc..84b18e973ac 100644 --- a/src/gnome/dialog-sx-editor.c +++ b/src/gnome/dialog-sx-editor.c @@ -217,7 +217,7 @@ sxed_confirmed_cancel(GncSxEditorDialog *sxed) const char *sx_changed_msg = _( "This SX has changed; are you " "sure you want to cancel?" ); - if (!gnc_verify_dialog(sxed->dialog, FALSE, sx_changed_msg)) { + if (!gnc_verify_dialog(sxed->dialog, FALSE, "%s", sx_changed_msg)) { return FALSE; } } @@ -635,7 +635,7 @@ gnc_sxed_check_consistent( GncSxEditorDialog *sxed ) _( "Couldn't parse credit formula for " "split \"%s\"." ), xaccSplitGetMemo( s ) ); - gnc_error_dialog( GTK_WIDGET(sxed->dialog), + gnc_error_dialog( GTK_WIDGET(sxed->dialog), "%s", errStr->str ); g_string_free( errStr, TRUE ); @@ -661,7 +661,7 @@ gnc_sxed_check_consistent( GncSxEditorDialog *sxed ) _( "Couldn't parse debit formula for " "split \"%s\"." ), xaccSplitGetMemo( s ) ); - gnc_error_dialog( GTK_WIDGET(sxed->dialog), + gnc_error_dialog( GTK_WIDGET(sxed->dialog), "%s", (gchar*)errStr->str ); g_string_free( errStr, TRUE ); @@ -712,7 +712,7 @@ gnc_sxed_check_consistent( GncSxEditorDialog *sxed ) if ( strlen(name) == 0 ) { const char *sx_has_no_name_msg = _( "Please name the Scheduled Transaction." ); - gnc_error_dialog( sxed->dialog, sx_has_no_name_msg ); + gnc_error_dialog( sxed->dialog, "%s", sx_has_no_name_msg ); g_free( name ); return FALSE; @@ -790,7 +790,7 @@ gnc_sxed_check_consistent( GncSxEditorDialog *sxed ) && !gtk_toggle_button_get_active(sxed->optEndNone) ) { const char *sx_end_spec_msg = _( "Please provide a valid end selection." ); - gnc_error_dialog( sxed->dialog, sx_end_spec_msg ); + gnc_error_dialog( sxed->dialog, "%s", sx_end_spec_msg ); return FALSE; } @@ -806,7 +806,7 @@ gnc_sxed_check_consistent( GncSxEditorDialog *sxed ) if ( occur == 0 ) { const char *sx_occur_count_zero_msg = _( "There must be some number of occurrences." ); - gnc_error_dialog( sxed->dialog, + gnc_error_dialog( sxed->dialog, "%s", sx_occur_count_zero_msg ); return FALSE; } @@ -847,7 +847,8 @@ gnc_sxed_check_consistent( GncSxEditorDialog *sxed ) _("You have attempted to create a Scheduled " "Transaction which will never run. Do you " "really want to do this?"); - if (!gnc_verify_dialog(sxed->dialog, FALSE, invalid_sx_check_msg)) + if (!gnc_verify_dialog(sxed->dialog, FALSE, + "%s", invalid_sx_check_msg)) return FALSE; } } @@ -1493,7 +1494,7 @@ gnc_sxed_reg_check_close(GncSxEditorDialog *sxed) return; } - if (gnc_verify_dialog(sxed->dialog, TRUE, message)) { + if (gnc_verify_dialog(sxed->dialog, TRUE, "%s", message)) { Transaction *trans; trans = gnc_split_register_get_current_trans( reg ); if ( !gnc_split_register_save( reg, TRUE ) ) diff --git a/src/gnome/druid-acct-period.c b/src/gnome/druid-acct-period.c index 6ddafc9bcdb..aa73533685e 100644 --- a/src/gnome/druid-acct-period.c +++ b/src/gnome/druid-acct-period.c @@ -361,7 +361,7 @@ ap_validate_menu (GnomeDruidPage *druidpage, const char *msg = _("You must select closing date that " "is greater than the closing date " "of the previous book."); - gnc_error_dialog (info->window, msg); + gnc_error_dialog (info->window, "%s", msg); return TRUE; } @@ -371,7 +371,7 @@ ap_validate_menu (GnomeDruidPage *druidpage, { const char *msg = _("You must select closing date " "that is not in the future."); - gnc_error_dialog (info->window, msg); + gnc_error_dialog (info->window, "%s", msg); return TRUE; } return FALSE; diff --git a/src/gnome/druid-loan.c b/src/gnome/druid-loan.c index 25f1384cd77..b5d1e80df82 100644 --- a/src/gnome/druid-loan.c +++ b/src/gnome/druid-loan.c @@ -1043,7 +1043,7 @@ ld_cancel_check( GnomeDruid *gd, LoanDruidData *ldd ) { const char *cancelMsg = _( "Are you sure you want to cancel " "the Mortgage/Loan Setup Druid?" ); - if ( gnc_verify_dialog( ldd->dialog, FALSE, cancelMsg ) ) { + if ( gnc_verify_dialog( ldd->dialog, FALSE, "%s", cancelMsg ) ) { gnc_close_gui_component_by_data( DIALOG_LOAN_DRUID_CM_CLASS, ldd ); } diff --git a/src/gnome/druid-merge.c b/src/gnome/druid-merge.c index d45ca78dd6c..66f766950c0 100644 --- a/src/gnome/druid-merge.c +++ b/src/gnome/druid-merge.c @@ -170,7 +170,7 @@ on_import_next (GnomeDruidPage *gnomedruidpage, message = g_strdup_printf(_("Error: Please resolve all %d " "conflicts before trying to commit the data."), count); top = gtk_widget_get_toplevel (GTK_WIDGET (gnomedruidpage)); - gnc_error_dialog(top, message); + gnc_error_dialog(top, "%s", message); g_free(message); return TRUE; } @@ -224,7 +224,7 @@ on_merge_finish (GnomeDruidPage *gnomedruidpage, if(result != 0) { message = g_strdup_printf(_("Error: the Commit operation failed, error code %d."), result); top = gtk_widget_get_toplevel (GTK_WIDGET (gnomedruidpage)); - gnc_error_dialog(top, message); + gnc_error_dialog(top, "%s", message); } g_return_if_fail(result == 0); delete_merge_window (); diff --git a/src/gnome/druid-stock-split.c b/src/gnome/druid-stock-split.c index 8c48c9aafc9..533be355aa9 100644 --- a/src/gnome/druid-stock-split.c +++ b/src/gnome/druid-stock-split.c @@ -306,7 +306,7 @@ gnc_stock_split_druid_details_next (GnomeDruidPage *druidpage, if (gnc_numeric_zero_p (amount)) { const char *message = _("You must enter a distribution amount."); - gnc_error_dialog (info->window, message); + gnc_error_dialog (info->window, "%s", message); return TRUE; } @@ -323,7 +323,7 @@ gnc_stock_split_druid_details_next (GnomeDruidPage *druidpage, if (gnc_numeric_negative_p (amount)) { const char *message = _("The price must be positive."); - gnc_error_dialog (info->window, message); + gnc_error_dialog (info->window, "%s", message); return TRUE; } @@ -370,7 +370,7 @@ gnc_stock_split_druid_cash_next (GnomeDruidPage *druidpage, if (gnc_numeric_negative_p (amount)) { const char *message = _("The cash distribution must be positive."); - gnc_error_dialog (info->window, message); + gnc_error_dialog (info->window, "%s", message); return TRUE; } @@ -383,7 +383,7 @@ gnc_stock_split_druid_cash_next (GnomeDruidPage *druidpage, { const char *message = _("You must select an income account " "for the cash distribution."); - gnc_error_dialog (info->window, message); + gnc_error_dialog (info->window, "%s", message); return TRUE; } @@ -392,7 +392,7 @@ gnc_stock_split_druid_cash_next (GnomeDruidPage *druidpage, { const char *message = _("You must select an asset account " "for the cash distribution."); - gnc_error_dialog (info->window, message); + gnc_error_dialog (info->window, "%s", message); return TRUE; } } diff --git a/src/gnome/gnc-plugin-basic-commands.c b/src/gnome/gnc-plugin-basic-commands.c index 730f9b29eb8..b2d8a8f4461 100644 --- a/src/gnome/gnc-plugin-basic-commands.c +++ b/src/gnome/gnc-plugin-basic-commands.c @@ -388,7 +388,7 @@ qsf_file_select_ok(GtkWidget *w, GtkFileSelection *fs ) PERR("%s", message); qof_session_destroy(qsf_session); qof_event_resume(); - gnc_error_dialog(gnc_ui_get_toplevel(), message); + gnc_error_dialog(gnc_ui_get_toplevel(), "%s", message); LEAVE (" "); return; } @@ -480,7 +480,7 @@ gnc_main_window_cmd_actions_since_last_run (GtkAction *action, GncMainWindowActi { if (summary.num_auto_create_no_notify_instances == 0) { - gnc_info_dialog(GTK_WIDGET(&window->gtk_window), nothing_to_do_msg); + gnc_info_dialog(GTK_WIDGET(&window->gtk_window), "%s", nothing_to_do_msg); } else { diff --git a/src/gnome/gnc-split-reg.c b/src/gnome/gnc-split-reg.c index 65a4e368ea1..ee48d3db0bc 100644 --- a/src/gnome/gnc-split-reg.c +++ b/src/gnome/gnc-split-reg.c @@ -1057,7 +1057,7 @@ gsr_default_delete_handler( GNCSplitReg *gsr, gpointer data ) | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, - buf); + "%s", buf); g_free(buf); recn = xaccSplitGetReconcile (split); if (recn == YREC || recn == FREC) diff --git a/src/gnome/window-reconcile.c b/src/gnome/window-reconcile.c index 8e7cb1c45c0..612ddd3184d 100644 --- a/src/gnome/window-reconcile.c +++ b/src/gnome/window-reconcile.c @@ -1136,7 +1136,7 @@ gnc_ui_reconcile_window_delete_cb(GtkButton *button, gpointer data) "transaction?"); gboolean result; - result = gnc_verify_dialog(recnData->window, FALSE, message); + result = gnc_verify_dialog(recnData->window, FALSE, "%s", message); if (!result) return; @@ -1825,7 +1825,7 @@ recn_cancel(RecnWindow *recnData) { const char *message = _("You have made changes to this reconcile " "window. Are you sure you want to cancel?"); - if (!gnc_verify_dialog(recnData->window, FALSE, message)) + if (!gnc_verify_dialog(recnData->window, FALSE, "%s", message)) return; } @@ -1937,7 +1937,7 @@ recnFinishCB (GtkAction *action, RecnWindow *recnData) { const char *message = _("The account is not balanced. " "Are you sure you want to finish?"); - if (!gnc_verify_dialog (recnData->window, FALSE, message)) + if (!gnc_verify_dialog (recnData->window, FALSE, "%s", message)) return; } @@ -1994,7 +1994,7 @@ recnPostponeCB (GtkAction *action, gpointer data) { const char *message = _("Do you want to postpone this reconciliation " "and finish it later?"); - if (!gnc_verify_dialog (recnData->window, FALSE, message)) + if (!gnc_verify_dialog (recnData->window, FALSE, "%s", message)) return; } diff --git a/src/import-export/hbci/hbci-interaction.c b/src/import-export/hbci/hbci-interaction.c index 20e0787023f..5ef48dac4c0 100644 --- a/src/import-export/hbci/hbci-interaction.c +++ b/src/import-export/hbci/hbci-interaction.c @@ -403,7 +403,7 @@ static int inputBoxCB(AB_BANKING *ab, minsize); retval = gnc_verify_dialog (GTK_WIDGET (data->parent), TRUE, - msg); + "%s", msg); g_free (msg); if (!retval) break; @@ -417,7 +417,7 @@ static int inputBoxCB(AB_BANKING *ab, (long)strlen(passwd), maxLen); retval = gnc_verify_dialog (GTK_WIDGET (data->parent), TRUE, - msg); + "%s", msg); g_free (msg); if (!retval) break; @@ -484,7 +484,7 @@ static int getTanCB(AB_BANKING *ab, minsize); retval = gnc_verify_dialog (GTK_WIDGET (data->parent), TRUE, - msg); + "%s", msg); g_free (msg); if (!retval) break; @@ -498,7 +498,7 @@ static int getTanCB(AB_BANKING *ab, (long)strlen(passwd), maxLen); retval = gnc_verify_dialog (GTK_WIDGET (data->parent), TRUE, - msg); + "%s", msg); g_free (msg); if (!retval) break; diff --git a/src/import-export/log-replay/gnc-log-replay.c b/src/import-export/log-replay/gnc-log-replay.c index 3daa1a55e75..5dfc3757fde 100644 --- a/src/import-export/log-replay/gnc-log-replay.c +++ b/src/import-export/log-replay/gnc-log-replay.c @@ -509,7 +509,7 @@ void gnc_file_log_replay (void) /* Use g_strdup_printf so we don't get accidental tab -> space conversion */ if (!expected_header) - expected_header = g_strdup_printf(expected_header_orig); + expected_header = g_strdup(expected_header_orig); qof_log_set_level(GNC_MOD_IMPORT, QOF_LOG_DEBUG); ENTER(" "); diff --git a/src/register/ledger-core/split-register-control.c b/src/register/ledger-core/split-register-control.c index 582e7daa279..ee799be76f5 100644 --- a/src/register/ledger-core/split-register-control.c +++ b/src/register/ledger-core/split-register-control.c @@ -1043,7 +1043,7 @@ gnc_split_register_handle_exchange (SplitRegister *reg, gboolean force_dialog) /* If this is an un-expanded, multi-split transaction, then warn the user */ if (force_dialog && !expanded && !xfer_acc) { - gnc_error_dialog (gnc_split_register_get_parent (reg), message); + gnc_error_dialog (gnc_split_register_get_parent (reg), "%s", message); return TRUE; } @@ -1092,7 +1092,7 @@ gnc_split_register_handle_exchange (SplitRegister *reg, gboolean force_dialog) if (!expanded && osplit && gnc_split_register_split_needs_amount (reg, split) && gnc_split_register_split_needs_amount (reg, osplit)) { - gnc_error_dialog (gnc_split_register_get_parent (reg), message); + gnc_error_dialog (gnc_split_register_get_parent (reg), "%s", message); return TRUE; } diff --git a/src/register/ledger-core/split-register.c b/src/register/ledger-core/split-register.c index 823d3dc7356..2c6bbe59c16 100644 --- a/src/register/ledger-core/split-register.c +++ b/src/register/ledger-core/split-register.c @@ -723,7 +723,7 @@ gnc_split_register_paste_current (SplitRegister *reg) if (split != NULL) result = gnc_verify_dialog (gnc_split_register_get_parent (reg), - FALSE, message); + FALSE, "%s", message); else result = TRUE; @@ -759,7 +759,7 @@ gnc_split_register_paste_current (SplitRegister *reg) if (split != blank_split) result = gnc_verify_dialog(gnc_split_register_get_parent(reg), - FALSE, message); + FALSE, "%s", message); else result = TRUE; diff --git a/src/report/report-gnome/gnc-plugin-page-report.c b/src/report/report-gnome/gnc-plugin-page-report.c index 92d87a409a2..6a09a756380 100644 --- a/src/report/report-gnome/gnc-plugin-page-report.c +++ b/src/report/report-gnome/gnc-plugin-page-report.c @@ -1345,7 +1345,7 @@ gnc_get_export_filename (SCM choice) { const char *message = _("You cannot save to that file."); - gnc_error_dialog (NULL, message); + gnc_error_dialog (NULL, "%s", message); g_free(filepath); return NULL; }