ICU-4822 uscript_getScript should return an invalid script enum when the arguments are invalid

X-SVN-Rev: 18524
This commit is contained in:
George Rhoten 2005-09-15 00:01:03 +00:00
parent 3a8ea47c3e
commit 39ad72f108

View File

@ -806,11 +806,11 @@ u_charAge(UChar32 c, UVersionInfo versionArray) {
U_CAPI UScriptCode U_EXPORT2
uscript_getScript(UChar32 c, UErrorCode *pErrorCode) {
if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) {
return 0;
return USCRIPT_INVALID_CODE;
}
if((uint32_t)c>0x10ffff) {
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
return 0;
return USCRIPT_INVALID_CODE;
}
return (UScriptCode)(u_getUnicodeProperties(c, 0)&UPROPS_SCRIPT_MASK);