Don't call g_utf8_strlen with a NULL pointer.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13083 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton 2006-02-03 00:47:40 +00:00
parent 6e63f6b452
commit b9724e3063
2 changed files with 12 additions and 2 deletions

View File

@ -1,5 +1,8 @@
2006-02-02 David Hampton <hampton@employees.org>
* src/register/register-core/numcell.c: Don't call g_utf8_strlen
with a NULL pointer. Fixes 329556.
* src/gnome-utils/gnc-tree-model-commodity.c:
* src/gnome-utils/gnc-tree-model-account.c:
* src/gnome-utils/gnc-tree-model-price.c: Better handling in the

View File

@ -88,10 +88,17 @@ gnc_num_cell_modify_verify (BasicCell *_cell,
gunichar uc;
glong change_chars;
if (change == NULL) /* if we are deleting */
/* then just accept the proposed change */
{
gnc_basic_cell_set_value_internal (&cell->cell, newval);
return;
}
change_chars = g_utf8_strlen (change, -1);
if ((change == NULL) || (change_chars == 0) || /* if we are deleting */
(change_chars > 1)) /* or entering > 1 char */
if ((change_chars == 0) || /* if we are deleting */
(change_chars > 1)) /* or entering > 1 char */
/* then just accept the proposed change */
{
gnc_basic_cell_set_value_internal (&cell->cell, newval);