From fbb5f5ba1f1427d78677007e019009abecc36120 Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Thu, 12 Sep 2013 00:02:41 +0000 Subject: [PATCH] ICU-10371 fix assertion in u_strFromUTF8()/u_strFromUTF8WithSub() code X-SVN-Rev: 34279 --- icu4c/source/common/ustrtrns.cpp | 6 ++++-- icu4c/source/test/cintltst/custrtrn.c | 13 +++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/icu4c/source/common/ustrtrns.cpp b/icu4c/source/common/ustrtrns.cpp index 57cabd58e2a..fbb7b46f309 100644 --- a/icu4c/source/common/ustrtrns.cpp +++ b/icu4c/source/common/ustrtrns.cpp @@ -1,7 +1,7 @@ /* ****************************************************************************** * -* Copyright (C) 2001-2012, International Business Machines +* Copyright (C) 2001-2013, International Business Machines * Corporation and others. All Rights Reserved. * ****************************************************************************** @@ -34,6 +34,8 @@ #include "ustr_imp.h" #include "uassert.h" +#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0])) + U_CAPI UChar* U_EXPORT2 u_strFromUTF32WithSub(UChar *dest, int32_t destCapacity, @@ -381,7 +383,7 @@ utf8_nextCharSafeBodyPointer(const uint8_t **ps, const uint8_t *limit, UChar32 c /* correct sequence - all trail bytes have (b7..b6)==(10)? */ /* illegal is also set if count>=4 */ - U_ASSERT(count