From 33148a3085d2a0f8557d17f5446a39aa16fae412 Mon Sep 17 00:00:00 2001 From: Yamagi Date: Sat, 10 Apr 2021 17:40:03 +0200 Subject: [PATCH] Revert "unix network little change proposal. socket port fits within unsigned 16 bits type." This reverts commit df3b2307f2a19ffcfde2fb7dce8fded4ee0c72e5. --- src/backends/unix/network.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backends/unix/network.c b/src/backends/unix/network.c index 4149e707..f0f2a6b9 100644 --- a/src/backends/unix/network.c +++ b/src/backends/unix/network.c @@ -62,7 +62,7 @@ int ip6_sockets[2]; int ipx_sockets[2]; char *multicast_interface = NULL; -int NET_Socket(char *net_interface, unsigned short port, netsrc_t type, int family); +int NET_Socket(char *net_interface, int port, netsrc_t type, int family); char *NET_ErrorString(void); void @@ -733,7 +733,7 @@ NET_OpenIP(void) { cvar_t *port, *ip; - port = Cvar_Get("port", va("%u", PORT_SERVER), CVAR_NOSET); + port = Cvar_Get("port", va("%i", PORT_SERVER), CVAR_NOSET); ip = Cvar_Get("ip", "localhost", CVAR_NOSET); if (!ip6_sockets[NS_SERVER]) @@ -803,7 +803,7 @@ NET_Config(qboolean multiplayer) /* =================================================================== */ int -NET_Socket(char *net_interface, unsigned short port, netsrc_t type, int family) +NET_Socket(char *net_interface, int port, netsrc_t type, int family) { char Buf[BUFSIZ], *Host, *Service; int newsocket, Error; @@ -837,7 +837,7 @@ NET_Socket(char *net_interface, unsigned short port, netsrc_t type, int family) } else { - sprintf(Buf, "%5u", port); + sprintf(Buf, "%5d", port); Service = Buf; }