fix:modify codec code check

Signed-off-by: crescenthe <sunhehe@huawei.com>
This commit is contained in:
crescenthe 2022-09-29 16:58:54 +08:00
parent 20c2e4d554
commit 5131113bf3

View File

@ -182,12 +182,12 @@ static char *GetArrayStr(int32_t *array, int32_t arrayLen, int32_t endValue)
HDF_LOGE("%{public}s: memset_s value failed, error code: %{public}d", __func__, ret);
return g_arrayStr;
}
ret = sprintf_s(value, sizeof(value) - 1, "0x0%X, ", array[i]);
ret = sprintf_s(value, sizeof(value), "0x0%X, ", array[i]);
if (ret < 0) {
HDF_LOGE("%{public}s: sprintf_s value failed, error code: %{public}d", __func__, ret);
return g_arrayStr;
}
len = strlen(value);
len = strnlen(value, ARRAY_TO_STR_LEN);
ret = memcpy_s(g_arrayStr + totalLen, len, value, len);
if (ret != EOK) {
HDF_LOGE("%{public}s: memcpy_s g_arrayStr failed, error code: %{public}d", __func__, ret);