Avoid check on _fcBankId nullness and fix case where it used to crash.

This commit is contained in:
Patrick Lam 2005-12-21 05:37:10 +00:00
parent 3bfae75d44
commit 19ea60bc7c
3 changed files with 9 additions and 2 deletions

View File

@ -6,6 +6,13 @@
Bump version to 2.3.93.
2005-12-20 Patrick Lam <plam@mit.edu>
* src/fccharset.c (FcLangCharSetPopulate):
* src/fcint.h (FcCacheBankToIndex):
Avoid check on _fcBankId nullness and fix case where it used to
crash.
2005-12-20 Patrick Lam <plam@mit.edu>
* src/fcxml.c (FcConfigParseAndLoad):

View File

@ -48,7 +48,7 @@ FcCharSetEnsureBank (int bi);
void
FcLangCharSetPopulate (void)
{
int bi = FcCacheBankToIndex (FC_BANK_LANGS);
int bi = FcCacheBankToIndexMTF (FC_BANK_LANGS);
FcCharSetEnsureBank (bi);
charsets[bi] = 0;
numbers[bi] = (FcChar16 *)&langBankNumbers;

View File

@ -469,7 +469,7 @@ FcCacheBankToIndexMTF (int bank);
static __inline__ int
FcCacheBankToIndex (int bank)
{
return (_fcBankId && _fcBankId[*_fcBankIdx] == bank) ? *_fcBankIdx : FcCacheBankToIndexMTF(bank);
return (_fcBankId[*_fcBankIdx] == bank) ? *_fcBankIdx : FcCacheBankToIndexMTF(bank);
}
const char *