net.dns: Make sure math.randomseed() gets passed an integer

Thu, 07 Jan 2010 01:26:01 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 07 Jan 2010 01:26:01 +0000
changeset 2788
fb47ac5ed04c
parent 2787
1067a454a068
child 2789
2419ca0bfab3

net.dns: Make sure math.randomseed() gets passed an integer

net/dns.lua file | annotate | diff | comparison | revisions
--- a/net/dns.lua	Sun Jan 03 11:26:36 2010 -0800
+++ b/net/dns.lua	Thu Jan 07 01:26:01 2010 +0000
@@ -183,7 +183,7 @@
 
 
 function dns.random(...)    -- - - - - - - - - - - - - - - - - - -  dns.random
-	math.randomseed(10000*socket.gettime());
+	math.randomseed(math.floor(10000*socket.gettime()));
 	dns.random = math.random;
 	return dns.random(...);
 end

mercurial