aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/netstat
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2012-01-03 18:51:58 +0000
committerEd Schouten <ed@FreeBSD.org>2012-01-03 18:51:58 +0000
commitb3608ae18f1e5598bed81d0a10dd585a5080c40d (patch)
treeb751618c7a82d9c00cab91ea9f611585dbf14d84 /usr.bin/netstat
parent69ee3e2f52eb8cba6e103cd1de3f91a7ffe1ddc7 (diff)
Notes
Diffstat (limited to 'usr.bin/netstat')
-rw-r--r--usr.bin/netstat/if.c2
-rw-r--r--usr.bin/netstat/inet.c2
-rw-r--r--usr.bin/netstat/inet6.c6
-rw-r--r--usr.bin/netstat/sctp.c6
4 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c
index 8a112708d77d4..a985791c6dfdc 100644
--- a/usr.bin/netstat/if.c
+++ b/usr.bin/netstat/if.c
@@ -256,7 +256,7 @@ intpr(int interval1, u_long ifnetaddr, void (*pfunc)(char *))
ifnetaddr = (u_long)TAILQ_NEXT(&ifnet, if_link);
if (interface != 0 && strcmp(name, interface) != 0)
continue;
- cp = index(name, '\0');
+ cp = strchr(name, '\0');
if (pfunc) {
(*pfunc)(name);
diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c
index 1653018f74ee1..7309951248218 100644
--- a/usr.bin/netstat/inet.c
+++ b/usr.bin/netstat/inet.c
@@ -1247,7 +1247,7 @@ inetprint(struct in_addr *in, int port, const char *proto, int num_port)
sprintf(line, "%s.", inetname(in));
else
sprintf(line, "%.*s.", (Aflag && !num_port) ? 12 : 16, inetname(in));
- cp = index(line, '\0');
+ cp = strchr(line, '\0');
if (!num_port && port)
sp = getservbyport((int)port, proto);
if (sp || port == 0)
diff --git a/usr.bin/netstat/inet6.c b/usr.bin/netstat/inet6.c
index 03fef6e167985..1a19fa535b5ee 100644
--- a/usr.bin/netstat/inet6.c
+++ b/usr.bin/netstat/inet6.c
@@ -1100,7 +1100,7 @@ inet6print(struct in6_addr *in6, int port, const char *proto, int numeric)
sprintf(line, "%.*s.", Wflag ? 39 :
(Aflag && !numeric) ? 12 : 16, inet6name(in6));
- cp = index(line, '\0');
+ cp = strchr(line, '\0');
if (!numeric && port)
GETSERVBYPORT6(port, proto, sp);
if (sp || port == 0)
@@ -1129,7 +1129,7 @@ inet6name(struct in6_addr *in6p)
if (first && !numeric_addr) {
first = 0;
if (gethostname(domain, MAXHOSTNAMELEN) == 0 &&
- (cp = index(domain, '.')))
+ (cp = strchr(domain, '.')))
(void) strcpy(domain, cp + 1);
else
domain[0] = 0;
@@ -1138,7 +1138,7 @@ inet6name(struct in6_addr *in6p)
if (!numeric_addr && !IN6_IS_ADDR_UNSPECIFIED(in6p)) {
hp = gethostbyaddr((char *)in6p, sizeof(*in6p), AF_INET6);
if (hp) {
- if ((cp = index(hp->h_name, '.')) &&
+ if ((cp = strchr(hp->h_name, '.')) &&
!strcmp(cp + 1, domain))
*cp = 0;
cp = hp->h_name;
diff --git a/usr.bin/netstat/sctp.c b/usr.bin/netstat/sctp.c
index d5ad70e658054..fb94d4435234a 100644
--- a/usr.bin/netstat/sctp.c
+++ b/usr.bin/netstat/sctp.c
@@ -162,7 +162,7 @@ inet6name(struct in6_addr *in6p)
if (first && !numeric_addr) {
first = 0;
if (gethostname(domain, MAXHOSTNAMELEN) == 0 &&
- (cp = index(domain, '.')))
+ (cp = strchr(domain, '.')))
(void) strcpy(domain, cp + 1);
else
domain[0] = 0;
@@ -171,7 +171,7 @@ inet6name(struct in6_addr *in6p)
if (!numeric_addr && !IN6_IS_ADDR_UNSPECIFIED(in6p)) {
hp = gethostbyaddr((char *)in6p, sizeof(*in6p), AF_INET6);
if (hp) {
- if ((cp = index(hp->h_name, '.')) &&
+ if ((cp = strchr(hp->h_name, '.')) &&
!strcmp(cp + 1, domain))
*cp = 0;
cp = hp->h_name;
@@ -209,7 +209,7 @@ sctp_print_address(union sctp_sockstore *address, int port, int num_port)
sprintf(line, "%.*s.", Wflag ? 39 : 16, "");
break;
}
- cp = index(line, '\0');
+ cp = strchr(line, '\0');
if (!num_port && port)
sp = getservbyport((int)port, "sctp");
if (sp || port == 0)