1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-28 10:29:03 +00:00

NSE: hnap-info minor code quality improvement

This commit is contained in:
tomsellers
2015-12-04 01:05:28 +00:00
parent c662f9cbd1
commit 25a27252ec

View File

@@ -105,11 +105,8 @@ function action (host, port)
}
parser:parseSAX(response.body, {stripWhitespace=true})
-- Counting size of entries in table to determine if it is empty
-- using the '#' operator is not reliable on tables
local count = 0
for _ in pairs(output) do count = count + 1 end
if count < 1 then return nil end
-- exit if the parser does not return output
if not next(output) then return nil end
-- set the port verson
port.version.name = "hnap"