From be7e57f80de753afdcfa3e1647b574a90d361e72 Mon Sep 17 00:00:00 2001 From: gyani Date: Sun, 14 Jun 2015 05:55:58 +0000 Subject: [PATCH] Removed WhiteSpace --- nselib/slaxml.lua | 4 ++-- scripts/hnap-info.nse | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nselib/slaxml.lua b/nselib/slaxml.lua index 10f9e3eb1..4e134ebf4 100644 --- a/nselib/slaxml.lua +++ b/nselib/slaxml.lua @@ -146,7 +146,7 @@ parser = { local entityMap = { ["lt"]="<", ["gt"]=">", ["amp"]="&", ["quot"]='"', ["apos"]="'" } - local entitySwap = function(orig,n,s) return entityMap[s] or n=="#" and utf8_enc(tonumber('0'..s)) or orig end + local entitySwap = function(orig,n,s) return entityMap[s] or n=="#" and utf8_enc(tonumber('0'..s)) or orig end local function unescape(str) return gsub( str, '(&(#?)([%d%a]+);)', entitySwap ) end local function finishText() @@ -309,7 +309,7 @@ parser = { while pos<#xml do if state=="text" then - if not (findPI() or findComment() or findCDATA() or findElementClose()) then + if not (findPI() or findComment() or findCDATA() or findElementClose()) then if startElement() then state = "attributes" else diff --git a/scripts/hnap-info.nse b/scripts/hnap-info.nse index 2494e4f2e..55e19420e 100644 --- a/scripts/hnap-info.nse +++ b/scripts/hnap-info.nse @@ -96,7 +96,7 @@ function action (host, port) closeElement = function(name) parser._call.text = function() return nil end end } parser:parseSAX(response.body, {stripWhitespace=true}) - + -- set the port verson port.version.name = "hnap" port.version.name_confidence = 10 @@ -104,12 +104,12 @@ function action (host, port) port.version.version = output["Model"] or nil port.version.devicetype = output["Type"] and output["Type"][1] or nil port.version.cpe = port.version.cpe or {} - + if output["Vendor"] and output["Model"] then table.insert(port.version.cpe, "cpe:/h:".. output["Vendor"]:lower() .. ":" .. output["Model"]:lower()) end nmap.set_port_version(host, port, "hardmatched") - + if #output >0 then return output end end end