From: Peter Verthez Date: Thu, 23 Jan 2003 21:33:58 +0000 (+0000) Subject: Fixed a nasty corruption bug. X-Git-Url: https://git.dlugolecki.net.pl/?a=commitdiff_plain;h=dd8bd9acd5c9daca1d4f534e4b4dd9b219ef7cb9;p=gedcom-parse.git Fixed a nasty corruption bug. --- diff --git a/gom/user_rec.c b/gom/user_rec.c index a685f3d..04f9961 100644 --- a/gom/user_rec.c +++ b/gom/user_rec.c @@ -181,6 +181,7 @@ Gedcom_ctxt user_elt_start(_ELT_PARAMS_) data->xref_value = GEDCOM_XREF_PTR(parsed_value); if (! err) { + printf("Tag: %s, value: %s\n", data->tag, data->str_value); switch (ctxt->obj_type) { case T_header: ADDFUNC2(header,user_data)(ctxt, data); break; @@ -317,13 +318,14 @@ int write_user_data(Gedcom_write_hndl hndl, struct user_data* data) if (!data) return 1; - for (obj = data; data; data = data->next) { + for (obj = data; obj; obj = obj->next) { if (obj->xref_value) result |= gedcom_write_user_xref(hndl, obj->level, obj->tag, NULL, obj->xref_value); - else + else { result |= gedcom_write_user_str(hndl, obj->level, obj->tag, NULL, obj->str_value); + } } return result; }