ICU-2135 Fixed the case where u_austrncpy would read one past the end of the array.

X-SVN-Rev: 9795
This commit is contained in:
George Rhoten 2002-08-27 22:45:05 +00:00
parent 20cd470111
commit fe09a02ac7

View File

@ -835,7 +835,7 @@ static int32_t u_ustrnlen(const UChar *ucs1, int32_t n)
if (ucs1)
{
while (*(ucs1++) && n--)
while (n-- && *(ucs1++))
{
len++;
}