Nmap Development mailing list archives

Variable number of arguments functions - arg not declared


From: Aleksandar Nikolic <nikolic.alek () gmail com>
Date: Mon, 28 May 2012 18:49:23 +0200

Hi all,


I've merged the changes from trunk to my exp branch
to change the scripts I'm working on to suit new lua updates.

I've had a problem with variable number of arguments functions
in rmi.lua library.

As far as I can tell, "arg" variable is deprecated in new version.

For example:

local function dbg(str,...)
        stdnse.print_debug(3,"RMI:"..str, table.unpack(arg))
end

Would throw an error saying arg was not declared.
I changed that to:

local function dbg(str,...)
        local arg={...}
        stdnse.print_debug(3,"RMI:"..str, table.unpack(arg))
end

Am I doing something wrong?
I'm bringing this to your attention as it might not be the only place
arg is used.


Aleksandar
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: