ICU-2809 gracefully exit when table has more than 64K stuff

X-SVN-Rev: 11883
This commit is contained in:
Vladimir Weinstein 2003-05-10 00:37:40 +00:00
parent 231b11fb9b
commit a083516404
3 changed files with 9 additions and 10 deletions

View File

@ -499,13 +499,14 @@ parseString(char *tag, uint32_t startline, UErrorCode *status)
doesn't survive expect either) */
result = string_open(bundle, tag, tokenValue->fChars, tokenValue->fLength, status);
if(U_SUCCESS(*status) && result) {
expect(TOK_CLOSE_BRACE, NULL, NULL, status);
expect(TOK_CLOSE_BRACE, NULL, NULL, status);
if (U_FAILURE(*status))
{
string_close(result, status);
return NULL;
if (U_FAILURE(*status))
{
string_close(result, status);
return NULL;
}
}
}
@ -1535,8 +1536,6 @@ parse(UCHARBUF *buf, const char *currentInputDir, UErrorCode *status)
if (U_FAILURE(*status))
{
/* realParseTable has already closed the table */
bundle->fRoot = NULL;
bundle_close(bundle, status);
return NULL;
}

View File

@ -916,7 +916,7 @@ uint16_t bundle_addtag(struct SRBRoot *bundle, const char *tag, UErrorCode *stat
return (uint16_t) - 1;
}
keypos = bundle->fKeyPoint;
keypos = (uint16_t)bundle->fKeyPoint;
bundle->fKeyPoint += (uint16_t) (uprv_strlen(tag) + 1);

View File

@ -34,7 +34,7 @@ U_CDECL_BEGIN
/* Resource bundle root table */
struct SRBRoot {
char *fLocale;
uint16_t fKeyPoint;
uint32_t fKeyPoint;
char *fKeys;
int32_t fCount;
struct SResource *fRoot;