diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-06-09 02:16:40 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-06-09 02:16:40 +0000 |
commit | 0761e7d4fe7786fb6111f30e0df57ce30a781d54 (patch) | |
tree | 5783292c2d4d1bbe76afe7189c6e20c19249654d | |
parent | fe7cb77bf344dfe9ac77276dd5d730280cb6453f (diff) |
use strchr() instead of index()
-rw-r--r-- | usr.bin/netstat/inet6.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/netstat/inet6.c b/usr.bin/netstat/inet6.c index 2627fcf1ac6..ac4e8c2e88b 100644 --- a/usr.bin/netstat/inet6.c +++ b/usr.bin/netstat/inet6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: inet6.c,v 1.21 2002/06/07 21:58:38 itojun Exp $ */ +/* $OpenBSD: inet6.c,v 1.22 2002/06/09 02:16:39 deraadt Exp $ */ /* BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp */ /* * Copyright (c) 1983, 1988, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)inet.c 8.4 (Berkeley) 4/20/94"; #else -/*__RCSID("$OpenBSD: inet6.c,v 1.21 2002/06/07 21:58:38 itojun Exp $");*/ +/*__RCSID("$OpenBSD: inet6.c,v 1.22 2002/06/09 02:16:39 deraadt Exp $");*/ /*__RCSID("KAME Id: inet6.c,v 1.10 2000/02/09 10:49:31 itojun Exp");*/ #endif #endif /* not lint */ @@ -1061,7 +1061,7 @@ do {\ if (vflag && width < strlen(inet6name(in6))) width = strlen(inet6name(in6)); snprintf(line, sizeof line, "%.*s.", width, inet6name(in6)); - cp = index(line, '\0'); + cp = strchr(line, '\0'); if (!nflag && port) GETSERVBYPORT6(port, proto, sp); if (sp || port == 0) @@ -1100,7 +1100,7 @@ inet6name(in6p) if (first && !nflag) { first = 0; if (gethostname(domain, sizeof(domain)) == 0 && - (cp = index(domain, '.'))) + (cp = strchr(domain, '.'))) (void) strlcpy(domain, cp + 1, sizeof domain); else domain[0] = '\0'; @@ -1109,7 +1109,7 @@ inet6name(in6p) if (!nflag && !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; |