if (d->day != -1)
sprintf(d->day_str, "%d", d->day);
- if (d->month != -1)
+ if (d->month > 0 && d->month <= max_month[d->cal])
strcpy(d->month_str, month_name[d->cal][d->month - 1]);
if (d->year_type == YEAR_SINGLE)
struct date_value gedcom_parse_date(const char* line_value)
{
int result = 0;
+ init_date(&dv_s.date1);
+ init_date(&dv_s.date2);
init_date(&date_s);
init_date(&def_date);
curr_line_value = line_value;
if (compat_mode(C_NO_REQUIRED_VALUES)
- && !strncmp(curr_line_value, "-", 2)) {
- gedcom_date_error(_("Empty value changed to '-'"));
+ && !strncmp(curr_line_value, VALUE_IF_MISSING, 2)) {
+ gedcom_date_error(_("Empty value changed to '%s'"), VALUE_IF_MISSING);
result = 1;
}
else {
}
if (result != 0) {
gedcom_date_error(_("Putting date in 'phrase' member"));
- make_date_value(DV_PHRASE, &def_date, &def_date, curr_line_value);
+ make_date_value(DV_PHRASE, &dv_s.date1, &dv_s.date2, curr_line_value);
}
return dv_s;
}