Use strcasecmp, not strcasestr, in hostcmp.

hostcmp is documented to determine whether "a and b are considered the
same hostnames." But what it's really doing is testing whether a
contains b. This isn't even symmetric, so I think it's wrong.
This commit is contained in:
david 2011-09-07 21:10:47 +00:00
parent 8b88d901a9
commit 4937b2e063

View file

@ -1837,7 +1837,7 @@ void printosscanoutput(Target *currenths) {
/* An auxillary function for printserviceinfooutput(). Returns
non-zero if a and b are considered the same hostnames. */
static int hostcmp(const char *a, const char *b) {
return strcasestr(a, b) ? 1 : 0;
return strcasecmp(a, b) == 0;
}
/* Prints the alternate hostname/OS/device information we got from the service