(svn r1465) -Fix: [1099101] starting year patch goes out of range. Clamped year between 1920-2090 as wel as adding defines for it.

This commit is contained in:
darkvater
2005-01-10 14:43:00 +00:00
parent fae367ab31
commit 29b4ab04c3
10 changed files with 22 additions and 19 deletions

View File

@@ -243,7 +243,7 @@ static byte *FormatYmdString(byte *buff, uint16 number)
memcpy(buff, GetStringPtr(STR_0162_JAN + ymd.month), 4);
buff[3] = ' ';
return FormatNoCommaNumber(buff+4, ymd.year + 1920);
return FormatNoCommaNumber(buff+4, ymd.year + MAX_YEAR_BEGIN_REAL);
}
static byte *FormatMonthAndYear(byte *buff, uint16 number)
@@ -256,7 +256,7 @@ static byte *FormatMonthAndYear(byte *buff, uint16 number)
for(src = GetStringPtr(STR_MONTH_JAN + ymd.month); (*buff++=*src++) != 0;) {}
buff[-1] = ' ';
return FormatNoCommaNumber(buff, ymd.year + 1920);
return FormatNoCommaNumber(buff, ymd.year + MAX_YEAR_BEGIN_REAL);
}
uint GetCurrentCurrencyRate() {