Skip to content

Commit 605ef23

Browse files
committed
Use macro MONTHS_PER_YEAR instead of '12' in /ecpg/pgtypeslib
All other places already use MONTHS_PER_YEAR appropriately. Backpatch-through: 9.6
1 parent 9e67a94 commit 605ef23

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/interfaces/ecpg/pgtypeslib/interval.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ DecodeISO8601Interval(char *str,
171171
{
172172
case 'Y':
173173
tm->tm_year += val;
174-
tm->tm_mon += (fval * 12);
174+
tm->tm_mon += (fval * MONTHS_PER_YEAR);
175175
break;
176176
case 'M':
177177
tm->tm_mon += val;
@@ -206,7 +206,7 @@ DecodeISO8601Interval(char *str,
206206
return DTERR_BAD_FORMAT;
207207

208208
tm->tm_year += val;
209-
tm->tm_mon += (fval * 12);
209+
tm->tm_mon += (fval * MONTHS_PER_YEAR);
210210
if (unit == '\0')
211211
return 0;
212212
if (unit == 'T')

0 commit comments

Comments
 (0)