X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=net.c;h=fa7cd4b80a7d96b26e35add01ad97d9a123f138d;hp=1b142a3cd4a25b87fe2e31c86caaf32e4be5f51e;hb=1709cc8f8a54429441f8f83c38146e667133c727;hpb=de9ce9690ac6194e8e7eaacd10baf21d827e42a4 diff --git a/net.c b/net.c index 1b142a3c..fa7cd4b8 100644 --- a/net.c +++ b/net.c @@ -175,8 +175,7 @@ char *parse_url(const char *url, } 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; @@ -187,6 +186,7 @@ failed: /** * 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. @@ -376,7 +376,7 @@ int lookup_address(unsigned l4type, bool passive, const char *host, 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;