diff --git a/icu4c/source/common/uloc_tag.cpp b/icu4c/source/common/uloc_tag.cpp index 73ff2b671666..01a0e0028f57 100644 --- a/icu4c/source/common/uloc_tag.cpp +++ b/icu4c/source/common/uloc_tag.cpp @@ -2124,7 +2124,7 @@ ultag_parse(const char* tag, int32_t tagLen, int32_t* parsedLen, UErrorCode* sta if (*redundantTagEnd == '\0' || *redundantTagEnd == SEP) { const char* preferredTag = REDUNDANT[i + 1]; size_t preferredTagLen = uprv_strlen(preferredTag); - uprv_strncpy(t->buf, preferredTag, preferredTagLen); + uprv_memcpy(t->buf, preferredTag, preferredTagLen); if (*redundantTagEnd == SEP) { uprv_memmove(tagBuf + preferredTagLen, redundantTagEnd,