Skip to content

Commit

Permalink
Merge pull request #250 from zerotier/brenton/fix-examples-warnings
Browse files Browse the repository at this point in the history
fix examples warnings
  • Loading branch information
joseph-henry authored Aug 19, 2023
2 parents 2a8670e + b1d088f commit f800bba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/c/nonblockingserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ int main(int argc, char** argv)
// zts_bsd_accept(int fd, struct zts_sockaddr* addr, zts_socklen_t* addrlen)

char remote_ipstr[ZTS_INET6_ADDRSTRLEN] = { 0 };
unsigned int port = 0;
unsigned short port = 0;
printf("Accepting on listening socket...\n");
if ((accfd = zts_accept(fd, remote_ipstr, ZTS_INET6_ADDRSTRLEN, &port)) < 0) {
printf("Error (fd=%d, ret=%d, zts_errno=%d). Exiting.\n", fd, err, zts_errno);
Expand Down
2 changes: 1 addition & 1 deletion examples/c/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ int main(int argc, char** argv)
// Can also use traditional: zts_bsd_socket(), zts_bsd_bind(), zts_bsd_listen(), zts_bsd_accept(), etc.

char remote_addr[ZTS_INET6_ADDRSTRLEN] = { 0 };
int remote_port = 0;
unsigned short remote_port = 0;
int len = ZTS_INET6_ADDRSTRLEN;
if ((accfd = zts_tcp_server(local_addr, local_port, remote_addr, len, &remote_port)) < 0) {
printf("Error (fd=%d, zts_errno=%d). Exiting.\n", accfd, zts_errno);
Expand Down

0 comments on commit f800bba

Please sign in to comment.