mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +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)
|
||||
|
||||
-- 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]
|
||||
i = i + 1
|
||||
end
|
||||
|
||||
@@ -148,7 +148,7 @@ action = function(host, port)
|
||||
end
|
||||
|
||||
|
||||
if table.getn(result) > 0 then
|
||||
if #result > 0 then
|
||||
result.name = "search amongst the " .. plugin_count .. " most popular plugins"
|
||||
return stdnse.format_output(true, result)
|
||||
else
|
||||
|
||||
@@ -101,7 +101,7 @@ local function create_instance_output_table( instance )
|
||||
end
|
||||
end
|
||||
|
||||
if ( table.getn( credsOutput ) == 0 ) then
|
||||
if ( #credsOutput == 0 ) then
|
||||
table.insert( instanceOutput, "No credentials found" )
|
||||
end
|
||||
end
|
||||
|
||||
@@ -152,7 +152,7 @@ local function process_instance( instance )
|
||||
for _, message in ipairs( instance.ms_sql_empty ) do
|
||||
table.insert( instanceOutput, message )
|
||||
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." )
|
||||
end
|
||||
end
|
||||
|
||||
@@ -209,7 +209,7 @@ function go(host, port)
|
||||
end
|
||||
end
|
||||
|
||||
for index = 1, table.getn(tests), 1 do
|
||||
for index = 1, #tests do
|
||||
status, response = do_request(socket, "RSET\r\n")
|
||||
|
||||
if not status then
|
||||
|
||||
Reference in New Issue
Block a user