Better behavior when the number-of-occurences field is blank.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15608 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Joshua Sled
2007-02-18 20:52:57 +00:00
parent 3afc270f8a
commit b567dc5360
2 changed files with 14 additions and 6 deletions

View File

@@ -63,12 +63,12 @@ TODO
- [ ] display-using src/gnome-utils/test/test-sx.c
- bugs
- [ ] sx-from-trans: "unknown get.type [3]" [dh20070120]_
- [ ] auto-create (+notify) txns not in review list. [ve20070209]_
- [ ] with SLR open (with instances), add variables to SX; only newly-created instances will have appropriate variable tables.
- [x] sx-from-trans: "unknown get.type [3]" [dh20070120]_
! - [x] crash with two sx lists open and SX mutation
- I'm pretty sure this is due to SX lists not getting cleaned up on page close, somehow.

View File

@@ -188,10 +188,18 @@ sxftd_get_end_info(SXFromTransInfo *sxfti)
guint n_occs;
w = glade_xml_get_widget(sxfti->gxml, SXFTD_N_OCCURRENCES_ENTRY);
text = gtk_editable_get_chars(GTK_EDITABLE(w), 0, -1);
n_occs = strtoul(text, &endptr, 10);
if ( !endptr ) {
n_occs = -1;
if (text == NULL || strlen(text) == 0)
{
n_occs = 0;
}
else
{
n_occs = strtoul(text, &endptr, 10);
if ( !endptr )
{
n_occs = -1;
}
}
g_free(text);