ICU-7677 fixed UErrorCode inconsistency and clarified length/overflow handling

X-SVN-Rev: 28196
This commit is contained in:
Markus Scherer 2010-06-15 16:24:45 +00:00
parent 3360fe4708
commit f59e726a30
2 changed files with 6 additions and 1 deletions

View file

@ -5556,7 +5556,7 @@ ucol_calcSortKeySimpleTertiary(const UCollator *coll,
goto cleanup;
}
} else {
*status = U_MEMORY_ALLOCATION_ERROR;
*status = U_BUFFER_OVERFLOW_ERROR;
}
}

View file

@ -729,6 +729,11 @@ ucol_normalizeShortDefinitionString(const char *source,
/**
* Get a sort key for a string from a UCollator.
* Sort keys may be compared using <TT>strcmp</TT>.
*
* Like ICU functions that write to an output buffer, the buffer contents
* is undefined if the buffer capacity (resultLength parameter) is too small.
* Unlike ICU functions that write a string to an output buffer,
* the terminating zero byte is counted in the sort key length.
* @param coll The UCollator containing the collation rules.
* @param source The string to transform.
* @param sourceLength The length of source, or -1 if null-terminated.