source:
npl/overig/netcat_openbsd/patches/0003-get-sev-by-name.patch
@
7c410f9
Last change on this file since 7c410f9 was c5c522c, checked in by , 8 years ago | |
---|---|
|
|
File size: 881 bytes |
-
netcat.c
From: Aron Xu <aron@debian.org> Date: Mon, 13 Feb 2012 14:45:08 +0800 Subject: get sev by name --- netcat.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/netcat.c b/netcat.c index f3cc8c1..d912544 100644
a b atelnet(int nfd, unsigned char *buf, unsigned int size) 949 949 void 950 950 build_ports(char *p) 951 951 { 952 struct servent *sv; 952 953 const char *errstr; 953 954 char *n; 954 955 int hi, lo, cp; 955 956 int x = 0; 956 957 957 if ((n = strchr(p, '-')) != NULL) { 958 sv = getservbyname(p, uflag ? "udp" : "tcp"); 959 if (sv) { 960 portlist[0] = calloc(1, PORT_MAX_LEN); 961 if (portlist[0] == NULL) 962 err(1, NULL); 963 snprintf(portlist[0], PORT_MAX_LEN, "%d", ntohs(sv->s_port)); 964 } else if ((n = strchr(p, '-')) != NULL) { 958 965 *n = '\0'; 959 966 n++; 960 967
Note: See TracBrowser
for help on using the repository browser.