From 2c6554a435cd03bfe7e7756f64cd273a362e938a Mon Sep 17 00:00:00 2001 From: batrick Date: Tue, 7 Oct 2008 02:24:31 +0000 Subject: [PATCH] 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. --- nselib/stdnse.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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))