Use macro MONTHS_PER_YEAR instead of '12' in /ecpg/pgtypeslib

All other places already use MONTHS_PER_YEAR appropriately.

Backpatch-through: 9.6
This commit is contained in:
Bruce Momjian 2021-04-02 16:42:29 -04:00
parent 4a1b95fcf4
commit 45aea47ef4

View File

@ -155,7 +155,7 @@ DecodeISO8601Interval(char *str,
{ {
case 'Y': case 'Y':
tm->tm_year += val; tm->tm_year += val;
tm->tm_mon += (fval * 12); tm->tm_mon += (fval * MONTHS_PER_YEAR);
break; break;
case 'M': case 'M':
tm->tm_mon += val; tm->tm_mon += val;
@ -191,7 +191,7 @@ DecodeISO8601Interval(char *str,
return DTERR_BAD_FORMAT; return DTERR_BAD_FORMAT;
tm->tm_year += val; tm->tm_year += val;
tm->tm_mon += (fval * 12); tm->tm_mon += (fval * MONTHS_PER_YEAR);
if (unit == '\0') if (unit == '\0')
return 0; return 0;
if (unit == 'T') if (unit == 'T')