update interfaces/cj/intl/src/intl_impl.cpp.

Signed-off-by: 小城茶语 <guorunzhi@huawei.com>
This commit is contained in:
小城茶语 2024-11-11 06:15:40 +00:00 committed by Gitee
parent b1f587cc96
commit 7fbddcbd49
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -266,7 +266,7 @@ CArrArrString RelativeTimeFormatImpl::FormatToParts(double number, char *unit)
for (size_t i = 0; i < timeVectorStr.size(); i++) { for (size_t i = 0; i < timeVectorStr.size(); i++) {
std::vector<std::string> timeVector = timeVectorStr[i]; std::vector<std::string> timeVector = timeVectorStr[i];
CArrString retime = {.head = nullptr, .size = 0}; CArrString retime = {.head = nullptr, .size = 0};
char **time = reinterpret_cast<char **>(malloc(sizeof(char *) * timeVector.size())); char **time = static_cast<char **>(malloc(sizeof(char *) * timeVector.size()));
if (time == nullptr) { if (time == nullptr) {
HILOG_ERROR_I18N("The char** is nullptr"); HILOG_ERROR_I18N("The char** is nullptr");
return ret; return ret;