Don't break for CONC on a space boundary.
[gedcom-parse.git] / gedcom / date.c
index 40cb18a7115eca0c5a86f2600e6c73b54b311dee..4f9878fb624553fd7255fce6ad84a1bcf15b86da 100644 (file)
@@ -336,7 +336,7 @@ int numbers_to_strings(struct date *d)
     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)
@@ -409,8 +409,8 @@ struct date_value gedcom_parse_date(const char* line_value)
   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 {