1
0
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:
dmiller
2014-02-13 15:47:41 +00:00
parent b73c3aa60f
commit a084340b6d
27 changed files with 440 additions and 430 deletions

View File

@@ -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