Skip to content
Snippets Groups Projects
Commit 24e1cdf32ef3 authored by Nick Wellnhofer's avatar Nick Wellnhofer
Browse files

Always initialize EXSLT month and day to 1

parent 1b51a380addb
No related branches found
No related tags found
No related merge requests found
......@@ -667,6 +667,11 @@
}
memset (ret, 0, sizeof(exsltDateVal));
if (type != XS_DURATION) {
ret->value.date.mon = 1;
ret->value.date.day = 1;
}
if (type != EXSLT_UNKNOWN)
ret->type = type;
......@@ -1395,6 +1400,6 @@
}
if ((type & XS_GDAY) != XS_GDAY)
dt->value.date.day = 0;
dt->value.date.day = 1;
if ((type & XS_GMONTH) != XS_GMONTH)
......@@ -1399,6 +1404,6 @@
if ((type & XS_GMONTH) != XS_GMONTH)
dt->value.date.mon = 0;
dt->value.date.mon = 1;
if ((type & XS_GYEAR) != XS_GYEAR)
dt->value.date.year = 0;
......@@ -1473,11 +1478,7 @@
d = &(dt->value.date);
u = &(dur->value.dur);
/* normalization */
if (d->mon == 0)
d->mon = 1;
/* normalize for time zone offset */
u->sec -= (d->tzo * 60); /* changed from + to - (bug 153000) */
d->tzo = 0;
......@@ -1480,11 +1481,7 @@
/* normalize for time zone offset */
u->sec -= (d->tzo * 60); /* changed from + to - (bug 153000) */
d->tzo = 0;
/* normalization */
if (d->day == 0)
d->day = 1;
/* month */
carry = d->mon + u->mon;
r->mon = (unsigned int)MODULO_RANGE(carry, 1, 13);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment