From fe09a02ac775ded095866d1f414a74225436ed6e Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Tue, 27 Aug 2002 22:45:05 +0000 Subject: [PATCH] ICU-2135 Fixed the case where u_austrncpy would read one past the end of the array. X-SVN-Rev: 9795 --- icu4c/source/common/ustring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icu4c/source/common/ustring.c b/icu4c/source/common/ustring.c index 373b99c8e7..db06709596 100644 --- a/icu4c/source/common/ustring.c +++ b/icu4c/source/common/ustring.c @@ -835,7 +835,7 @@ static int32_t u_ustrnlen(const UChar *ucs1, int32_t n) if (ucs1) { - while (*(ucs1++) && n--) + while (n-- && *(ucs1++)) { len++; }