AUDIT: r15204 - gnucash/trunk/src/app-utils - Check for potentially failed utf8 conversion of locale strings. bug#383270

Christian Stimming cstim at cvs.gnucash.org
Mon Dec 11 17:28:38 EST 2006


Author: cstim
Date: 2006-12-11 17:28:36 -0500 (Mon, 11 Dec 2006)
New Revision: 15204
Trac: http://svn.gnucash.org/trac/changeset/15204

Modified:
   gnucash/trunk/src/app-utils/gnc-ui-util.c
Log:
Check for potentially failed utf8 conversion of locale strings. bug#383270
BP

Modified: gnucash/trunk/src/app-utils/gnc-ui-util.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-ui-util.c	2006-12-11 17:48:44 UTC (rev 15203)
+++ gnucash/trunk/src/app-utils/gnc-ui-util.c	2006-12-11 22:28:36 UTC (rev 15204)
@@ -734,6 +734,11 @@
     *p_value = default_value;
 
   *p_value = g_locale_to_utf8 (*p_value, -1, NULL, NULL, NULL);
+  if (*p_value == NULL) {
+    // The g_locale_to_utf8 conversion failed. FIXME: Should we rather
+    // use an empty string instead of the default_value? Not sure.
+    *p_value = default_value;
+  }
   // FIXME: Do we really need to make a copy here ?
   //*p_value = g_strdup (*p_value);
 }



More information about the gnucash-changes mailing list