mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-14 17:24:01 +00:00
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
1 changed files with 2 additions and 2 deletions
|
@ -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…
Add table
Reference in a new issue