git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c30f54a)
Use macro MONTHS_PER_YEAR instead of '12' in /ecpg/pgtypeslib
Fri, 2 Apr 2021 20:42:29 +0000 (16:42 -0400)
Fri, 2 Apr 2021 20:42:38 +0000 (16:42 -0400)
All other places already use MONTHS_PER_YEAR appropriately.

Backpatch-through: 9.6


diff --git a/src/interfaces/ecpg/pgtypeslib/interval.c b/src/interfaces/ecpg/pgtypeslib/interval.c
index 82196dfe80af7884de8e0b9bb6a604840a115e1d..4245016c8e83bf39fa87dd81b3047c47af86c84c 100644 (file)
--- a/src/interfaces/ecpg/pgtypeslib/interval.c
+++ b/src/interfaces/ecpg/pgtypeslib/interval.c
@@ -155,7 +155,7 @@ DecodeISO8601Interval(char *str,
{
case 'Y':
tm->tm_year += val;
- tm->tm_mon += (fval * 12);
+ tm->tm_mon += (fval * MONTHS_PER_YEAR);
break;
case 'M':
tm->tm_mon += val;
@@ -191,7 +191,7 @@ DecodeISO8601Interval(char *str,
return DTERR_BAD_FORMAT;
tm->tm_year += val;
- tm->tm_mon += (fval * 12);
+ tm->tm_mon += (fval * MONTHS_PER_YEAR);
if (unit == '0円')
return 0;
if (unit == 'T')
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /