From 25a27252ec410fe2e18f6cab5645c9f277098396 Mon Sep 17 00:00:00 2001 From: tomsellers Date: Fri, 4 Dec 2015 01:05:28 +0000 Subject: [PATCH] NSE: hnap-info minor code quality improvement --- scripts/hnap-info.nse | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/hnap-info.nse b/scripts/hnap-info.nse index 02ae47c5a..6f752ec3e 100644 --- a/scripts/hnap-info.nse +++ b/scripts/hnap-info.nse @@ -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"