1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-20 05:09:02 +00:00

Compare string contents, not pointer values.

This bug was introduced in r30334. We want to compare the contents of
the strings, not their addresses. This bug caused host script results to
be printed in arbitrary, perhaps not even well-defined, order.
This commit is contained in:
david
2013-06-14 17:26:43 +00:00
parent 7684b43072
commit 6238087e9b

View File

@@ -451,7 +451,7 @@ std::string protect_xml(const std::string s) {
/* This is a helper function to determine the ordering of the script results
based on their id. */
static bool scriptid_lessthan(ScriptResult a, ScriptResult b) {
return a.get_id() < b.get_id();
return strcmp(a.get_id(), b.get_id()) < 0;
}
static char *formatScriptOutput(ScriptResult sr) {