mirror of
https://github.com/nmap/nmap.git
synced 2026-01-04 13:49:03 +00:00
Remove useless calls to string.format
stdnse.print_debug accepts a format string and arguments, making
string.format redundant in calls of this form:
stdnse.print_debug(1, string.format("%s: error", SCRIPT_NAME))
stdnse.print_debug(("length %d"):format(#tab))
These can be rewritten as:
stdnse.print_debug(1, "%s: error", SCRIPT_NAME)
stdnse.print_debug("length %d", #tab)
This commit is contained in:
@@ -385,8 +385,9 @@ SERVICES = {
|
||||
|
||||
if ( octet1 ~= 127 ) then
|
||||
-- This should'nt happen :P
|
||||
stdnse.print_debug(string.format(
|
||||
"The request made to dnsbl.httpbl.org was considered invalid (%i)", octet1))
|
||||
stdnse.print_debug(
|
||||
"The request made to dnsbl.httpbl.org was considered invalid (%i)",
|
||||
octet1)
|
||||
elseif ( "short" == self.mode ) then
|
||||
return { state = "ATTACK" }
|
||||
else
|
||||
@@ -625,7 +626,7 @@ Helper = {
|
||||
local svc_result = svc:resp_parser(answer)
|
||||
if ( not(svc_result) ) then
|
||||
local resp = ( #answer > 0 and ("UNKNOWN (%s)"):format(answer[1]) or "UNKNOWN" )
|
||||
stdnse.print_debug(2, ("%s received %s"):format(name, resp))
|
||||
stdnse.print_debug(2, "%s received %s", name, resp)
|
||||
end
|
||||
|
||||
if ( svc_result ) then
|
||||
|
||||
Reference in New Issue
Block a user