We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7cc7b56 commit ace05b1Copy full SHA for ace05b1
samples/socket-api/wasm-src/multicast_client.c
@@ -53,7 +53,7 @@ main(int argc, char *argv[])
53
struct ip_mreq ipv4_group;
54
int sd;
55
int datalen;
56
- char databuf[1024];
+ char databuf[1024] = { 0 };
57
char multicast_addr_buffer[16];
58
struct sockaddr_storage local_address = { 0 };
59
int addr_type = -1;
@@ -116,7 +116,7 @@ main(int argc, char *argv[])
116
117
printf("Joined multicast group. Waiting for datagram...\n");
118
119
- datalen = sizeof(databuf);
+ datalen = sizeof(databuf) - 1;
120
read_result = read(sd, databuf, datalen);
121
122
if (read_result < 0) {
@@ -132,4 +132,4 @@ main(int argc, char *argv[])
132
fail:
133
close(sd);
134
return EXIT_FAILURE;
135
-}
+}
0 commit comments