fix:内源代码检视修改
【背景】3.1代码review问题修改 【修改方案】 re #I4WV56 Signed-off-by: xuiny <xuxinyu6@huawei.com> Change-Id: I1f3d98ab84b739c5d3a924559b1825659dc0ea74
This commit is contained in:
parent
73b77d11a1
commit
632ea10418
|
@ -527,7 +527,7 @@ static void ping_cmd(u32_t *parg)
|
|||
if (ret < 0) {
|
||||
PRINTK("Ping cmd failed due to some errors\n");
|
||||
}
|
||||
|
||||
free(parg);
|
||||
ping_taskid = -1;
|
||||
}
|
||||
|
||||
|
@ -589,7 +589,6 @@ u32_t OsShellPing(int argc, const char **argv)
|
|||
stPingTask.uwArg = (UINTPTR)parg;
|
||||
ret = LOS_TaskCreate((UINT32 *)(&ping_taskid), &stPingTask);
|
||||
if (ret != LOS_OK) {
|
||||
free(parg);
|
||||
PRINTK("ping_task create failed 0x%08x.\n", ret);
|
||||
count = LWIP_SHELL_CMD_PING_RETRY_TIMES;
|
||||
} else {
|
||||
|
|
|
@ -36,9 +36,9 @@ static UINT32 TestCase(VOID)
|
|||
{
|
||||
CHAR *p = (CHAR *)LOS_MemAlloc(g_testLmsPool, INDEX_MAX);
|
||||
ICUNIT_ASSERT_NOT_EQUAL(p, NULL, 0);
|
||||
memset_s(p, INDEX_MAX, 0, INDEX_MAX + 1);
|
||||
(void)memset_s(p, INDEX_MAX, 0, INDEX_MAX + 1);
|
||||
PRINTK("p[0] = %d\n", p[0]);
|
||||
memset_s(p, INDEX_MAX + 1, 0, INDEX_MAX + 1); /* trigger overflow */
|
||||
(void)memset_s(p, INDEX_MAX + 1, 0, INDEX_MAX + 1); /* trigger overflow */
|
||||
|
||||
return LOS_OK;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ static UINT32 TestCase(VOID)
|
|||
|
||||
memcpy_s(p, INDEX_MAX, src, INDEX_MAX + 1);
|
||||
PRINTK("p[0] = %d\n", p[0]);
|
||||
memcpy_s(p, INDEX_MAX + 1, 0, INDEX_MAX + 1); /* trigger overflow */
|
||||
(void)memcpy_s(p, INDEX_MAX + 1, 0, INDEX_MAX + 1); /* trigger overflow */
|
||||
|
||||
return LOS_OK;
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ void SemTimedWaitFuzzTest(void)
|
|||
|
||||
absTimeout.tv_sec = (*(int *)DT_SetGetS32(&g_element[elemSecIndex], 0)) % SEC_MODE_VALUE;
|
||||
absTimeout.tv_nsec = (*(int *)DT_SetGetS32(&g_element[elemNsecIndex], 0) % NSEC_MODE_VALUE);
|
||||
memset_s(&sem, sizeof(sem), 0, sizeof(sem_t));
|
||||
(void)memset_s(&sem, sizeof(sem), 0, sizeof(sem_t));
|
||||
pshared = (*(int *)DT_SetGetS32(&g_element[1], DEFAULT_SHARED_VALUE));
|
||||
value = (*(unsigned int *)DT_SetGetU32(&g_element[1], 0)) % MAX_SEM_VALUE;
|
||||
sem_init(&sem, pshared, value);
|
||||
|
|
|
@ -123,7 +123,7 @@ static void *SampleUdpClient()
|
|||
clnAddr.sin_port = htons(g_udpPort);
|
||||
|
||||
printf("c3\r\n");
|
||||
strcpy_s(buf, sizeof(buf), UDPMSG);
|
||||
(void)strcpy_s(buf, sizeof(buf), UDPMSG);
|
||||
|
||||
usleep(sleepSec);
|
||||
printf("c4, %s, %d\r\n", buf, strlen(buf));
|
||||
|
@ -266,7 +266,7 @@ static void *SampleTcpClient()
|
|||
if (err != EOK) {
|
||||
return (void *)(intptr_t)ret;
|
||||
}
|
||||
strcpy_s(buf, sizeof(buf), CLI_MSG);
|
||||
(void)strcpy_s(buf, sizeof(buf), CLI_MSG);
|
||||
|
||||
int num2 = *(int *)DT_SetGetS32(&g_element[1], 0);
|
||||
send(num1, buf, strlen(CLI_MSG), num2);
|
||||
|
|
|
@ -211,7 +211,7 @@ LITE_TEST_CASE(PosixStringFuncTestSuite, testStrStrcspn002, Function | MediumTes
|
|||
LITE_TEST_CASE(PosixStringFuncTestSuite, testStrStrptime001, Function | MediumTest | Level1)
|
||||
{
|
||||
struct tm tmData;
|
||||
memset_s(&tmData, sizeof(struct tm), 0, sizeof(struct tm));
|
||||
(void)memset_s(&tmData, sizeof(struct tm), 0, sizeof(struct tm));
|
||||
char *ret = strptime("2020-10-29 21:24:00abc", "%Y-%m-%d %H:%M:%S", &tmData);
|
||||
TEST_ASSERT_EQUAL_CHAR_ARRAY(ret, "abc", 3);
|
||||
TEST_ASSERT_EQUAL_INT(tmData.tm_year, 120);
|
||||
|
|
Loading…
Reference in New Issue