Content-Length: 275469 | pFad | http://github.com/postgrespro/postgres/commit/6972d9104b6c54bae2fd63d8e02e9c014d162ca3

6A Use macro MONTHS_PER_YEAR instead of '12' in /ecpg/pgtypeslib · postgrespro/postgres@6972d91 · GitHub
Skip to content

Commit 6972d91

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 53f5c2d commit 6972d91

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/interfaces/ecpg/pgtypeslib/interval.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ DecodeISO8601Interval(char *str,
155155
{
156156
case 'Y':
157157
tm->tm_year += val;
158-
tm->tm_mon += (fval * 12);
158+
tm->tm_mon += (fval * MONTHS_PER_YEAR);
159159
break;
160160
case 'M':
161161
tm->tm_mon += val;
@@ -191,7 +191,7 @@ DecodeISO8601Interval(char *str,
191191
return DTERR_BAD_FORMAT;
192192

193193
tm->tm_year += val;
194-
tm->tm_mon += (fval * 12);
194+
tm->tm_mon += (fval * MONTHS_PER_YEAR);
195195
if (unit == '\0')
196196
return 0;
197197
if (unit == 'T')

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/6972d9104b6c54bae2fd63d8e02e9c014d162ca3

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy