diff --git a/output.cc b/output.cc index 41cfbf554..00bff1994 100644 --- a/output.cc +++ b/output.cc @@ -512,11 +512,11 @@ 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) { +static bool scriptid_lessthan(const ScriptResult &a, const ScriptResult &b) { return strcmp(a.get_id(), b.get_id()) < 0; } -static char *formatScriptOutput(ScriptResult sr) { +static char *formatScriptOutput(const ScriptResult &sr) { std::vector lines; std::string c_output; diff --git a/portlist.cc b/portlist.cc index fdbb7aa35..31012b055 100644 --- a/portlist.cc +++ b/portlist.cc @@ -440,7 +440,7 @@ void PortList::setServiceProbeResults(u16 portno, int protocol, #ifndef NOLUA -void PortList::addScriptResult(u16 portno, int protocol, ScriptResult& sr) { +void PortList::addScriptResult(u16 portno, int protocol, const ScriptResult& sr) { Port *port; port = createPort(portno, protocol); diff --git a/portlist.h b/portlist.h index 6b7d892b9..76448b6dd 100644 --- a/portlist.h +++ b/portlist.h @@ -308,7 +308,7 @@ class PortList { void getServiceDeductions(u16 portno, int protocol, struct serviceDeductions *sd) const; #ifndef NOLUA - void addScriptResult(u16 portno, int protocol, ScriptResult& sr); + void addScriptResult(u16 portno, int protocol, const ScriptResult& sr); #endif /* Cycles through the 0 or more "ignored" ports which should be