mirror of
https://github.com/nmap/nmap.git
synced 2025-12-25 08:59:01 +00:00
Use string.gsub to strip nulls instead of a lua loop.
This commit is contained in:
@@ -89,11 +89,7 @@ local function request(comm, procedure, data)
|
||||
end
|
||||
|
||||
local function stripnull(str)
|
||||
local e = -1
|
||||
while str:byte(e) == 0 do
|
||||
e = e - 1
|
||||
end
|
||||
return str:sub(1,e)
|
||||
return (str:gsub("\0*$",""))
|
||||
end
|
||||
|
||||
local function decode_reply(data, pos)
|
||||
|
||||
Reference in New Issue
Block a user