mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 13:11:28 +00:00
removed usage of deprecated table.getn
This commit is contained in:
@@ -227,7 +227,7 @@ function build_domain(host)
|
|||||||
abs_name = listop.reverse(abs_name)
|
abs_name = listop.reverse(abs_name)
|
||||||
|
|
||||||
-- prepend each element with its length
|
-- prepend each element with its length
|
||||||
while i <= table.getn(abs_name) do
|
while i <= #abs_name do
|
||||||
buf = buf .. string.char(string.len(abs_name[i])) .. abs_name[i]
|
buf = buf .. string.char(string.len(abs_name[i])) .. abs_name[i]
|
||||||
i = i + 1
|
i = i + 1
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ action = function(host, port)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if table.getn(result) > 0 then
|
if #result > 0 then
|
||||||
result.name = "search amongst the " .. plugin_count .. " most popular plugins"
|
result.name = "search amongst the " .. plugin_count .. " most popular plugins"
|
||||||
return stdnse.format_output(true, result)
|
return stdnse.format_output(true, result)
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ local function create_instance_output_table( instance )
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if ( table.getn( credsOutput ) == 0 ) then
|
if ( #credsOutput == 0 ) then
|
||||||
table.insert( instanceOutput, "No credentials found" )
|
table.insert( instanceOutput, "No credentials found" )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ local function process_instance( instance )
|
|||||||
for _, message in ipairs( instance.ms_sql_empty ) do
|
for _, message in ipairs( instance.ms_sql_empty ) do
|
||||||
table.insert( instanceOutput, message )
|
table.insert( instanceOutput, message )
|
||||||
end
|
end
|
||||||
if ( nmap.verbosity() > 1 and table.getn( instance.ms_sql_empty ) == 0 ) then
|
if ( nmap.verbosity() > 1 and #instance.ms_sql_empty == 0 ) then
|
||||||
table.insert( instanceOutput, "'sa' account password is not blank." )
|
table.insert( instanceOutput, "'sa' account password is not blank." )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ function go(host, port)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for index = 1, table.getn(tests), 1 do
|
for index = 1, #tests do
|
||||||
status, response = do_request(socket, "RSET\r\n")
|
status, response = do_request(socket, "RSET\r\n")
|
||||||
|
|
||||||
if not status then
|
if not status then
|
||||||
|
|||||||
Reference in New Issue
Block a user