ICU-200 pointer wrap-around handling for os/400

X-SVN-Rev: 899
This commit is contained in:
Markus Scherer 2000-03-07 01:26:15 +00:00
parent 0ed984343c
commit 3de59e84c0

View File

@ -643,8 +643,10 @@ int32_t ucnv_fromUChars (const UConverter * converter,
mySource_limit = mySource + mySourceLength;
myTarget_limit = target + targetSize;
if(myTarget_limit < target) /*if targetsize is such that the limit*/
myTarget_limit = (char *)U_MAX_PTR; /* would wrap around, truncate it. */
/* Pin the limit to U_MAX_PTR. NULL check is for AS/400. */
if((myTarget_limit < target) || (myTarget_limit == NULL)) {
myTarget_limit = (char *)U_MAX_PTR;
}
if (targetSize > 0)
{
@ -752,9 +754,9 @@ int32_t ucnv_toUChars (const UConverter * converter,
if (targetSize > 0)
{
myTarget_limit = target + targetSize - 1;
/*if targetsize is such that the limit*/
if (myTarget_limit < target) {
/* would wrap around, truncate it. */
/* Pin the limit to U_MAX_PTR. NULL check is for AS/400. */
if ((myTarget_limit == NULL) || (myTarget_limit < target)) {
myTarget_limit = ((UChar*)U_MAX_PTR) - 1;
}