Remove hand-written version of strcspn().

The code searches for the first occurence of @, : or !. Upon failure, it
returns the index of \0. This is exactly what strcspn() does.
This commit is contained in:
Ed Schouten 2012-01-03 11:13:07 +00:00
parent b589816c74
commit 75ac3edf1d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=229386
1 changed files with 1 additions and 2 deletions

View File

@ -80,8 +80,7 @@ get_names(int argc, char *argv[])
gethostname(hostname, sizeof (hostname));
my_machine_name = hostname;
/* check for, and strip out, the machine name of the target */
for (cp = argv[1]; *cp && !index("@:!", *cp); cp++)
;
cp = argv[1] + strcspn(argv[1], "@:!");
if (*cp == '\0') {
/* this is a local to local talk */
his_name = argv[1];