Compare commits

...

5 Commits

Author SHA1 Message Date
openharmony_ci
56565beeb6 !668 修复fatfs中GetLdPath无法正常返回结果
Merge pull request !668 from xiexg-dc/riscv32-virt
2022-04-11 06:18:21 +00:00
openharmony_ci
a77aa7de98 !670 fix: 告警修复
Merge pull request !670 from Zhaotianyu/0408codex_fix
2022-04-11 02:05:02 +00:00
openharmony_ci
db8c284cd1 !670 fix: 告警修复
Merge pull request !670 from Zhaotianyu/0408codex_fix
2022-04-11 02:05:01 +00:00
arvinzzz
b1daca7f82 fix: 告警修复
Signed-off-by: arvinzzz <zhaotianyu9@huawei.com>
Change-Id: If3c36a8b2d3ad3c825bc3e5ef68efa8896d54884
2022-04-08 16:11:12 +08:00
xiexg-dc
46546688c9 fix: 修复fatfs中GetLdPath无法正常返回结果
fix: #I4XBJ6

Signed-off-by: xiexg-dc <xiexg@digitalchina.com>
Change-Id: I919d48de744f01f56b6fb7376b8b770386380197
2022-04-06 10:37:03 +08:00
2 changed files with 6 additions and 5 deletions

View File

@@ -236,6 +236,7 @@ static int FatfsErrno(int result)
char * GetLdPath(const char *source)
{
#define LDPATH_PAD 2 // 2 means: strlen("/") + len of '\0'
int ret;
int partId = GetPartIdByPartName(source);
if ((partId < 0) || (partId >= MAX_PARTITION_NUM)) {
@@ -243,16 +244,16 @@ char * GetLdPath(const char *source)
}
char *volPath = g_volPath[partId];
char *ldPath = (char *)malloc(strlen(volPath) + 1);
char *ldPath = (char *)malloc(strlen(volPath) + LDPATH_PAD);
if (ldPath == NULL) {
return NULL;
}
(void)memset_s(ldPath, strlen(volPath) + 1, 0, strlen(volPath) + 1);
(void)memset_s(ldPath, strlen(volPath) + LDPATH_PAD, 0, strlen(volPath) + LDPATH_PAD);
/* Convert volPath to ldpath, for example, convert "inner" to "/inner" */
*ldPath = '/';
ret = strcpy_s(ldPath + 1, strlen(volPath), volPath);
ret = strcpy_s(ldPath + 1, strlen(volPath)+1, volPath);
if (ret != EOK) {
free(ldPath);
return NULL;

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
@@ -196,7 +196,7 @@ LITE_OS_SEC_TEXT_MINOR VOID OsCmdAscendingInsert(CmdItemNode *cmd)
}
for (cmdItem = LOS_DL_LIST_ENTRY((&cmdInfo.cmdList.list)->pstPrev, CmdItemNode, list);
&cmdItem->list != &(cmdInfo.cmdList.list); ) {
&cmdItem->list != &(cmdInfo.cmdList.list);) {
cmdNext = LOS_DL_LIST_ENTRY(cmdItem->list.pstPrev, CmdItemNode, list);
if (&cmdNext->list != &(cmdInfo.cmdList.list)) {
if ((strncmp(cmdItem->cmd->cmdKey, cmd->cmd->cmdKey, strlen(cmd->cmd->cmdKey)) >= 0) &&