mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Updated stdnse.tohex() to coerce strings to numbers if possible for the first
argument. That is, the first argument is interpretted as a number if possible.
This commit is contained in:
parent
f71135f796
commit
2c6554a435
1 changed files with 1 additions and 1 deletions
|
|
@ -163,7 +163,7 @@ function tohex( s, options )
|
|||
local separator = options.separator
|
||||
local hex
|
||||
|
||||
if type( s ) == 'number' then
|
||||
if tonumber( s ) then
|
||||
hex = ("%x"):format(s)
|
||||
elseif type( s ) == 'string' then
|
||||
hex = ("%02x"):rep(#s):format(s:byte(1,#s))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue