ICU-447 fix for Windows 2000/Solaris CC differences. The unsafe macro is not called when the utf8 character is larger than the size of the array.

X-SVN-Rev: 2121
This commit is contained in:
George Rhoten 2000-08-07 21:27:51 +00:00
parent 33a776e6e5
commit 6ccfa23662

View File

@ -208,8 +208,8 @@ void TestNextPrevChar(){
12, 12, 12, 1, 1, 1,
13, 13, 13, 1, 1, 1,
14, 14, 14, 1, 1, 1,
18, 15, 15, 1, 1, 1,
16, 16, 16, 0, 0, 0,
14, 15, 15, 1, 1, 1,
14, 16, 16, 0, 0, 0,
};
@ -219,6 +219,7 @@ void TestNextPrevChar(){
uint32_t i=0;
uint32_t offset=0, setOffset=0;
for(offset=0; offset<sizeof(input); offset++){
if (offset < sizeof(input) - 2) { /* Can't have it go off the end of the array based on input */
setOffset=offset;
UTF8_NEXT_CHAR_UNSAFE(input, setOffset, c);
if(setOffset != movedOffset[i]){
@ -228,6 +229,7 @@ void TestNextPrevChar(){
if(c != result[i]){
log_err("ERROR: UTF8_NEXT_CHAR_UNSAFE failed for offset=%ld. Expected:%lx Got:%lx\n", offset, result[i], c);
}
}
setOffset=offset;
UTF8_NEXT_CHAR_SAFE(input, setOffset, sizeof(input), c, FALSE);
if(setOffset != movedOffset[i+1]){