mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 09:13:20 +03:00 
			
		
		
		
	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:
		@@ -171,7 +171,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;
 | 
			
		||||
@@ -206,7 +206,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')
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user