diff --git a/icu4c/source/common/ucnv.c b/icu4c/source/common/ucnv.c index 98e507c748..b652f6c16c 100644 --- a/icu4c/source/common/ucnv.c +++ b/icu4c/source/common/ucnv.c @@ -745,7 +745,7 @@ int32_t ucnv_fromUChars (const UConverter * converter, myTarget_limit = target + targetSize; if(myTarget_limit < target) /*if targetsize is such that the limit*/ - myTarget_limit = U_MAX_PTR; /* would wrap around, truncate it. */ + myTarget_limit = (char *)U_MAX_PTR; /* would wrap around, truncate it. */ if (targetSize > 0) { @@ -853,7 +853,7 @@ int32_t ucnv_toUChars (const UConverter * converter, myTarget_limit = target + targetSize - 1; if(myTarget_limit < target) /*if targetsize is such that the limit*/ - myTarget_limit = U_MAX_PTR - 1; /* would wrap around, truncate it. */ + myTarget_limit = ((UChar*)U_MAX_PTR) - 1; /* would wrap around, truncate it. */ /*Not in pure pre-flight mode */ diff --git a/icu4c/source/common/unistr.cpp b/icu4c/source/common/unistr.cpp index b77cd7daac..8a4925d9a4 100644 --- a/icu4c/source/common/unistr.cpp +++ b/icu4c/source/common/unistr.cpp @@ -785,7 +785,7 @@ UnicodeString::extract(UTextOffset start, myTargetLimit = myTarget + arraySize; if(myTargetLimit < myTarget) /* ptr wrapped around: pin to U_MAX_PTR */ - myTargetLimit = U_MAX_PTR; + myTargetLimit = (char*)U_MAX_PTR; // perform the conversion // there is no loop here since we assume the buffer is large enough