Update HAL_TCP_module.c

1.in function HAL_TCP_Connect,  '    char port_str[PORT_BUFF_LEN];  memset(port_str, 0, PORT_BUFF_LEN);', we can direct to replace with  'char port_str[PORT_BUFF_LEN] = {0};'
This commit is contained in:
LinPeng
2020-01-20 11:37:45 +08:00
committed by GitHub
parent 3a43c0159c
commit 45dfc729fc

View File

@@ -43,9 +43,8 @@ static uint32_t _time_left(uint32_t t_end, uint32_t t_now)
uintptr_t HAL_TCP_Connect(const char *host, uint16_t port) uintptr_t HAL_TCP_Connect(const char *host, uint16_t port)
{ {
int fd; int fd;
char port_str[PORT_BUFF_LEN]; char port_str[PORT_BUFF_LEN] = {0};
memset(port_str, 0, PORT_BUFF_LEN);
snprintf(port_str, PORT_BUFF_LEN, "%u", port); snprintf(port_str, PORT_BUFF_LEN, "%u", port);
Log_i("osal_tcp_connect entry, host=%s port=%d(%s)", host , port, port_str); Log_i("osal_tcp_connect entry, host=%s port=%d(%s)", host , port, port_str);