mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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:
parent
b589816c74
commit
75ac3edf1d
1 changed files with 1 additions and 2 deletions
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Reference in a new issue