diff --git a/nselib/stdnse.lua b/nselib/stdnse.lua index 2354c5b49..fb65846e3 100644 --- a/nselib/stdnse.lua +++ b/nselib/stdnse.lua @@ -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))