ICU-4822 uscript_getScript should return an invalid script enum when the arguments are invalid
X-SVN-Rev: 18524
This commit is contained in:
parent
3a8ea47c3e
commit
39ad72f108
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user