mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 06:40:48 +00:00
Use string.gsub to strip nulls instead of a lua loop.
This commit is contained in:
parent
b136a4a80f
commit
c6b8199c14
1 changed files with 1 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue