From 4937b2e063516af5268b892ac4a507d88d074af7 Mon Sep 17 00:00:00 2001 From: david Date: Wed, 7 Sep 2011 21:10:47 +0000 Subject: [PATCH] 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. --- output.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/output.cc b/output.cc index 153356627..7165f48d1 100644 --- a/output.cc +++ b/output.cc @@ -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