modify codecheck

Signed-off-by: lifansheng <lifansheng1@huawei.com>
This commit is contained in:
lifansheng
2021-09-22 15:55:53 +08:00
parent ed749f2402
commit 3280afb36c
3 changed files with 74 additions and 21 deletions
+3 -2
View File
@@ -45,7 +45,8 @@ namespace OHOS::Util {
(i32Flag & static_cast<uint32_t>(ConverterFlags::FATAL_FLG)) ==
static_cast<uint32_t>(ConverterFlags::FATAL_FLG);
UErrorCode codeflag = U_ZERO_ERROR;
UConverter *conv = ucnv_open(encStr_.c_str(), &codeflag);
char *pStr = const_cast<char*>(encStr_.c_str());
UConverter *conv = ucnv_open(pStr, &codeflag);
if (U_FAILURE(codeflag)) {
HILOG_ERROR("ucnv_open failed !");
return;
@@ -174,7 +175,7 @@ namespace OHOS::Util {
void TextDecoder::SetBomFlag(const UChar *arr, const UErrorCode codeFlag, const DecodeArr decArr,
size_t &rstLen, bool &bomFlag)
{
if (arr == nullptr) {
if (arr == nullptr ) {
return;
}
if (U_SUCCESS(codeFlag)) {