diff options
author | Marco d'Itri <md@linux.it> | 2006-07-19 21:01:32 +0200 |
---|---|---|
committer | Marco d'Itri <md@linux.it> | 2013-03-30 02:31:34 +0100 |
commit | 7c5dbcc6c6607a113e3414483d9f2b23f55d5070 (patch) | |
tree | 33e89334ef537aebae8968c3ed2b6f6232967d8c /whois.c | |
parent | 6077928ad947f17e29dabae38a2edb24f0e319bd (diff) | |
download | whois-7c5dbcc6c6607a113e3414483d9f2b23f55d5070.tar.gz |
Imported Debian version 4.7.15v4.7.15
Diffstat (limited to 'whois.c')
-rw-r--r-- | whois.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -802,7 +802,7 @@ void split_server_port(const char *const input, if (p && *(p + 1) != '\0') *port = strdup(p + 1); /* IPv6 + port */ } else if ((p = strchr(input, ':')) && /* IPv6, no port */ - strchr(p, ':')) { /* and no brackets */ + strchr(p + 1, ':')) { /* and no brackets */ *server = strdup(input); } else if ((p = strchr(input, ':'))) { /* IPv4 + port */ char *s; @@ -812,8 +812,9 @@ void split_server_port(const char *const input, memcpy(s, input, len); *(s + len) = '\0'; - if (*(p + 1) != '\0') - *port = strdup(p + 1); + p++; + if (*p != '\0') + *port = strdup(p); } else { /* IPv4, no port */ *server = strdup(input); } |