mirror of
https://github.com/nmap/nmap.git
synced 2026-01-29 01:29:22 +00:00
revert tonumber() conversion in stdnse.tohex() because tonumber() discards whitespace
This commit is contained in:
@@ -163,7 +163,7 @@ function tohex( s, options )
|
||||
local separator = options.separator
|
||||
local hex
|
||||
|
||||
if tonumber( s ) then
|
||||
if type( s ) == "number" then
|
||||
hex = ("%x"):format(s)
|
||||
elseif type( s ) == 'string' then
|
||||
hex = ("%02x"):rep(#s):format(s:byte(1,#s))
|
||||
|
||||
Reference in New Issue
Block a user