r12006 - gnucash/trunk - Convert a couple of dialogs from the deprecated gnome_ok_dialog to a

Christian Stimming stimming at tuhh.de
Mon Nov 21 03:38:43 EST 2005


Hi David,

thanks for converting these dialog functions into the up-to-date 
gtk_message_dialog functions. However, IMHO there's one caveat here: The 
gtk_message_dialog_new() expects a printf()-style char* message_format 
string as the first text message, and only the subsequent arguments are 
pure strings that will be shown. In other words, if the first char* 
argument or any of its translations inadvertantly contains a '%' 
character, then this will be misinterpreted as a formatting argument and 
the function will crash. This means that any gtk_message_dialog_new with 
only one string argument needs to be written as
(..., "%s", message_string);
instead. It is not sufficient to check that the message string doesn't 
contain a '%' character -- any of its translations might contain one, so 
that's out of the programmer's control. Or did I miss something here?

Christian


David Hampton schrieb:
> Author: hampton
> Date: 2005-11-21 01:51:57 -0500 (Mon, 21 Nov 2005)
> New Revision: 12006
> Trac: http://svn.gnucash.org/trac/changeset/12006
> 
> Modified:
>    gnucash/trunk/ChangeLog
>    gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.c
>    gnucash/trunk/src/import-export/hbci/gnc-hbci-gettrans.c
>    gnucash/trunk/src/import-export/hbci/hbci-interaction.c
> Log:
> Convert a couple of dialogs from the deprecated gnome_ok_dialog to a
> gtk_message_dialog.
> 
> 
> _______________________________________________
> gnucash-patches mailing list
> gnucash-patches at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-patches
> 


More information about the gnucash-devel mailing list