diff --git a/nselib/stdnse.lua b/nselib/stdnse.lua index 276e991c1..9e9a93e8b 100644 --- a/nselib/stdnse.lua +++ b/nselib/stdnse.lua @@ -440,7 +440,7 @@ local function format_output_sub(status, data, indent) -- Initialize the output string to blank (or, if we're at the top, add a newline) local output = "" if(not(indent)) then - output = ' \n' + output = '\n' end if(not(status)) then @@ -556,7 +556,7 @@ function format_output(status, data, indent) local result = format_output_sub(status, data, indent) -- Check for an empty result - if(result == nil or #result == "" or result == "\n" or result == " \n") then + if(result == nil or #result == "" or result == "\n" or result == "\n") then return nil end diff --git a/scripts/asn-query.nse b/scripts/asn-query.nse index 5bdd329f9..05e47fa28 100644 --- a/scripts/asn-query.nse +++ b/scripts/asn-query.nse @@ -457,6 +457,6 @@ function nice_output( output, combined_records ) end -- return combined and formatted answers - return (" \n%s"):format( table.concat( output, "\n" ) ) + return "\n" .. table.concat( output, "\n" ) end diff --git a/scripts/citrix-brute-xml.nse b/scripts/citrix-brute-xml.nse index 328bc8531..5e652b0a3 100644 --- a/scripts/citrix-brute-xml.nse +++ b/scripts/citrix-brute-xml.nse @@ -99,7 +99,7 @@ function create_result_from_table(accounts) result = result .. " " .. account.username .. ":" .. account.password .. " => " .. account.message .. "\n" end - return " \n" .. result + return "\n" .. result end action = function(host, port) diff --git a/scripts/daap-get-library.nse b/scripts/daap-get-library.nse index 7186da00c..dfe39ea93 100644 --- a/scripts/daap-get-library.nse +++ b/scripts/daap-get-library.nse @@ -326,7 +326,7 @@ action = function(host, port) local output = stdnse.format_output( true, results ) if limit > 0 then - output = output .. string.format(" \n\nOutput limited to %d items", limit ) + output = output .. string.format("\n\nOutput limited to %d items", limit ) end return output diff --git a/scripts/dns-zone-transfer.nse b/scripts/dns-zone-transfer.nse index 9695a674d..52e0a8239 100644 --- a/scripts/dns-zone-transfer.nse +++ b/scripts/dns-zone-transfer.nse @@ -406,5 +406,5 @@ action = function(host, port) end soc:close() - return ' \n' .. tab.dump(table) + return '\n' .. tab.dump(table) end diff --git a/scripts/firewalk.nse b/scripts/firewalk.nse index 79b6e01fc..94e04109d 100644 --- a/scripts/firewalk.nse +++ b/scripts/firewalk.nse @@ -442,6 +442,6 @@ action = function(host) sock:ip_close() pcap:pcap_close() - return " \n" .. report(ports, fwdports) + return "\n" .. report(ports, fwdports) end diff --git a/scripts/ldap-search.nse b/scripts/ldap-search.nse index c63a4b62b..04f3b5959 100644 --- a/scripts/ldap-search.nse +++ b/scripts/ldap-search.nse @@ -213,7 +213,7 @@ function action(host,port) -- catch any softerrors if searchResEntries.resultCode ~= 0 then local output = stdnse.format_output(true, result ) - output = output .. string.format(" \n\n\n=========== %s ===========", searchResEntries.errorMessage ) + output = output .. string.format("\n\n\n=========== %s ===========", searchResEntries.errorMessage ) return output end @@ -233,7 +233,7 @@ function action(host,port) local output = stdnse.format_output(true, result ) if ( maxObjects ~= -1 and objCount == maxObjects ) then - output = output .. (" \n\nResult limited to %d objects (see ldap.maxobjects)"):format(maxObjects) + output = output .. ("\n\nResult limited to %d objects (see ldap.maxobjects)"):format(maxObjects) end return output diff --git a/scripts/qscan.nse b/scripts/qscan.nse index 0596e775c..aac85d8a9 100644 --- a/scripts/qscan.nse +++ b/scripts/qscan.nse @@ -507,6 +507,6 @@ action = function(host) calcfamilies(stats, conf) - return " \n" .. report(stats) + return "\n" .. report(stats) end diff --git a/scripts/smb-enum-processes.nse b/scripts/smb-enum-processes.nse index 5558ade05..0403e5186 100644 --- a/scripts/smb-enum-processes.nse +++ b/scripts/smb-enum-processes.nse @@ -283,7 +283,7 @@ action = function(host) if nmap.verbosity() == 0 then response = "|_ " .. stdnse.strjoin(", ", names) else - response = " \n" .. psl_print(psl, nmap.verbosity()) + response = "\n" .. psl_print(psl, nmap.verbosity()) end return response diff --git a/scripts/whois.nse b/scripts/whois.nse index c7250a7b8..3ac16d516 100644 --- a/scripts/whois.nse +++ b/scripts/whois.nse @@ -1281,14 +1281,14 @@ function format_data_for_output( data ) for _, field_name in ipairs( fields ) do if type( field_name ) == "string" and data[object_name][field_name] then - output[#output+1] = " \n" + output[#output+1] = "\n" output[#output+1] = field_name output[#output+1] = ": " output[#output+1] = data[object_name][field_name] elseif type( field_name ) == "table" then - output[#output+1] = " \n" + output[#output+1] = "\n" for _, field_name_sameline in ipairs( field_name ) do if type( field_name_sameline ) == "string" and data[object_name][field_name_sameline] then