Commit bc29813a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

Remove dead code (VLC only uses port numbers, not service names ever)

parent 42f6cf04
...@@ -402,34 +402,10 @@ getaddrinfo (const char *node, const char *service, ...@@ -402,34 +402,10 @@ getaddrinfo (const char *node, const char *service,
char *end; char *end;
d = strtoul (service, &end, 0); d = strtoul (service, &end, 0);
if (end[0] /* service is not a number */ if (end[0] || (d > 65535u))
|| (d > 65535)) return EAI_SERVICE;
{
struct servent *entry;
const char *protoname;
switch (protocol)
{
case IPPROTO_TCP:
protoname = "tcp";
break;
case IPPROTO_UDP:
protoname = "udp";
break;
default:
protoname = NULL;
}
entry = getservbyname (service, protoname);
if (entry == NULL)
return EAI_SERVICE;
port = entry->s_port; port = htons ((u_short)d);
}
else
port = htons ((u_short)d);
} }
/* building results... */ /* building results... */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment