diff options
| author | Brenton Bostick <[email protected]> | 2023-08-18 08:31:08 -0400 |
|---|---|---|
| committer | Brenton Bostick <[email protected]> | 2023-08-18 08:36:31 -0400 |
| commit | b1d088f39cf2e7730ea1b5433be1b76893f2725b (patch) | |
| tree | d668ebae7ee2c9a4963cd307e41e620fb8f01684 | |
| parent | 624038dd93ca0d416bb20102e41ca67ea51335d4 (diff) | |
fix examples warnings
warning: incompatible pointer types passing 'int *' to parameter of type 'unsigned short *' [-Wincompatible-pointer-types]
| -rw-r--r-- | examples/c/nonblockingserver.c | 2 | ||||
| -rw-r--r-- | examples/c/server.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/c/nonblockingserver.c b/examples/c/nonblockingserver.c index 228bcb2..8b5c312 100644 --- a/examples/c/nonblockingserver.c +++ b/examples/c/nonblockingserver.c @@ -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); diff --git a/examples/c/server.c b/examples/c/server.c index b3c606c..e43a00f 100644 --- a/examples/c/server.c +++ b/examples/c/server.c @@ -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); |
