mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-21 04:29:31 +00:00
ICU-1103 'cal' bug under ja locale
X-SVN-Rev: 6750
This commit is contained in:
parent
ef2d44b84a
commit
e450946b2f
1 changed files with 10 additions and 1 deletions
|
@ -299,7 +299,7 @@ get_months(const UChar *months [],
|
|||
return;
|
||||
monthBundle = ures_getByKey(bundle, key, NULL, status);
|
||||
count = ures_countArrayItems(bundle, key, status);
|
||||
if(count != MONTH_COUNT)
|
||||
if(count < (MONTH_COUNT-1)) /* Some locales have 13 months, no idea why */
|
||||
goto finish; /* sanity check */
|
||||
for(i = 0; i < count; ++i) {
|
||||
months[i] = ures_getStringByIndex(monthBundle, i, &monthLen, status);
|
||||
|
@ -316,6 +316,11 @@ indent(int32_t count,
|
|||
FILE *f)
|
||||
{
|
||||
char c [BUF_SIZE];
|
||||
|
||||
if(count <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(count < BUF_SIZE) {
|
||||
memset(c, (int)' ', count);
|
||||
|
@ -413,6 +418,10 @@ print_month(UCalendar *c,
|
|||
|
||||
/* Indent the correct number of spaces for the first week */
|
||||
current = firstday;
|
||||
if(current < 0)
|
||||
{
|
||||
current += 7;
|
||||
}
|
||||
for(i = 0; i < current; ++i)
|
||||
indent(lens[i] + 1, stdout);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue