Skip to content

Commit

Permalink
fix:添加 remote_ip 结构体初始化为0 ,修复编译出错
Browse files Browse the repository at this point in the history
  • Loading branch information
wl committed Dec 19, 2023
1 parent 1022265 commit 9d9bb83
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion project/example_pm/src/example_socket_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static void demo_socket_pm_task(void *arg)
char helloworld[] = "helloworld";
char txbuf[128] = {0};

ip_addr_t remote_ip;
ip_addr_t remote_ip={0};
struct sockaddr_in name;
socklen_t sockaddr_t_size = sizeof(name);
int ret, h_errnop;
Expand Down Expand Up @@ -146,6 +146,7 @@ static void demo_socket_pm_task(void *arg)
{
socket_id = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
memset(&name, 0, sizeof(name));

name.sin_family = AF_INET;
name.sin_addr.s_addr = remote_ip.u_addr.ip4.addr;
name.sin_port = htons(DEMO_SERVER_TCP_PORT);
Expand Down

0 comments on commit 9d9bb83

Please sign in to comment.