Make passing of commandline arguments safe and avoid malloc