1
0
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:
dmiller
2015-02-25 03:34:31 +00:00
parent b136a4a80f
commit c6b8199c14

View File

@@ -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)