1
0
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:
sven
2008-10-07 07:28:10 +00:00
parent 840b276b6c
commit 8f83450228

View File

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