From 6238087e9b21b791fdf80eb860c2886b485fbd25 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 14 Jun 2013 17:26:43 +0000 Subject: [PATCH] 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. --- output.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/output.cc b/output.cc index b0474e371..1bb429114 100644 --- a/output.cc +++ b/output.cc @@ -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) {