server: Convert non-afs commands to lopsub.
[paraslash.git] / net.c
diff --git a/net.c b/net.c
index 1b142a3cd4a25b87fe2e31c86caaf32e4be5f51e..fa7cd4b80a7d96b26e35add01ad97d9a123f138d 100644 (file)
--- a/net.c
+++ b/net.c
@@ -175,8 +175,7 @@ char *parse_url(const char *url,
        }
 
        if (*o == ':')
        }
 
        if (*o == ':')
-               if (para_atoi32(++o, port) < 0 ||
-                   *port < 0 || *port > 0xffff)
+               if (para_atoi32(++o, port) < 0 || *port < 0 || *port > 0xffff)
                        goto failed;
        if (host_string_ok(host))
                return host;
                        goto failed;
        if (host_string_ok(host))
                return host;
@@ -187,6 +186,7 @@ failed:
 
 /**
  * Stringify port number, resolve into service name where defined.
 
 /**
  * Stringify port number, resolve into service name where defined.
+ *
  * \param port 2-byte port number, in host-byte-order.
  * \param transport Transport protocol name (e.g. "udp", "tcp"), or NULL.
  * \return Pointer to static result buffer.
  * \param port 2-byte port number, in host-byte-order.
  * \param transport Transport protocol name (e.g. "udp", "tcp"), or NULL.
  * \return Pointer to static result buffer.
@@ -376,7 +376,7 @@ int lookup_address(unsigned l4type, bool passive, const char *host,
        struct addrinfo *addr = NULL, hints;
 
        *result = NULL;
        struct addrinfo *addr = NULL, hints;
 
        *result = NULL;
-       sprintf(port, "%u", port_number & 0xffff);
+       sprintf(port, "%d", port_number & 0xffff);
        /* Set up address hint structure */
        memset(&hints, 0, sizeof(hints));
        hints.ai_family = AF_UNSPEC;
        /* Set up address hint structure */
        memset(&hints, 0, sizeof(hints));
        hints.ai_family = AF_UNSPEC;