mirror of
https://github.com/nmap/nmap.git
synced 2025-12-15 20:29:03 +00:00
Clean up string concatenations
Building a string with var = var .. "something" has miserable time complexities. This commit cleans up a lot of that in scripts, focusing on packing of data with bin.pack and concatenations within loops. Additionally, a few instances were replaced with string.rep
This commit is contained in:
@@ -113,11 +113,7 @@ end
|
||||
--@return String description for output
|
||||
local output = function(passwd, dir)
|
||||
local trunc, len = truncatePasswd(passwd)
|
||||
local out = ""
|
||||
out = out .. "Directory traversal found.\nPayload: \"" .. dir .. "\"\n"
|
||||
out = out .. "Printing first " .. len .. " bytes:\n"
|
||||
out = out .. trunc
|
||||
return out
|
||||
return ('Directory traversal found.\nPayload: "%s"\nPrinting first %d bytes:\n%s'):format(dir, len, trunc)
|
||||
end
|
||||
|
||||
portrule = shortport.http
|
||||
|
||||
Reference in New Issue
Block a user