X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/46f4442e9a5a4f3b98b7c1083586332f6a8a99a4..f3c0d7a59d99c2a94c6b8822291f0e42be3773c9:/icuSources/i18n/unesctrn.cpp diff --git a/icuSources/i18n/unesctrn.cpp b/icuSources/i18n/unesctrn.cpp index c3d848d0..86c55d13 100644 --- a/icuSources/i18n/unesctrn.cpp +++ b/icuSources/i18n/unesctrn.cpp @@ -1,6 +1,8 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html /* ********************************************************************** - * Copyright (c) 2001-2008, International Business Machines + * Copyright (c) 2001-2011, International Business Machines * Corporation and others. All Rights Reserved. ********************************************************************** * Date Name Description @@ -13,6 +15,7 @@ #if !UCONFIG_NO_TRANSLITERATION #include "unicode/uchar.h" +#include "unicode/utf16.h" #include "unesctrn.h" #include "util.h" @@ -84,7 +87,7 @@ static UChar* copySpec(const UChar* spec) { UChar *result = (UChar *)uprv_malloc(len*sizeof(UChar)); // Check for memory allocation error. if (result != NULL) { - uprv_memcpy(result, spec, len*sizeof(result[0])); + uprv_memcpy(result, spec, (size_t)len*sizeof(result[0])); } return result; } @@ -229,7 +232,7 @@ void UnescapeTransliterator::handleTransliterate(Replaceable& text, UTransPositi if (digit < 0) { break; } - s += UTF_CHAR_LENGTH(ch); + s += U16_LENGTH(ch); u = (u * radix) + digit; if (++digitCount == maxDigits) { break; @@ -273,7 +276,7 @@ void UnescapeTransliterator::handleTransliterate(Replaceable& text, UTransPositi } if (start < limit) { - start += UTF_CHAR_LENGTH(text.char32At(start)); + start += U16_LENGTH(text.char32At(start)); } }