]> git.donarmstrong.com Git - infobot.git/commitdiff
off by one?
authortimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Mon, 28 Jun 2004 18:25:51 +0000 (18:25 +0000)
committertimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Mon, 28 Jun 2004 18:25:51 +0000 (18:25 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@961 c11ca15a-4712-0410-83d8-924469b57eb5

src/dbi.pl

index b0abee1123faf984528142782e61edbf9b1d3f0e..138c5ccd360f2018b28e18c2331a0dfe55f69c2e 100644 (file)
@@ -514,7 +514,7 @@ sub sumKey {
 # Usage: &randKey($table, $select);
 sub randKey {
     my ($table, $select) = @_;
-    my $rand   = int(rand(&countKeys($table) - 1));
+    my $rand   = int(rand(&countKeys($table)));
     my $query  = "SELECT $select FROM $table LIMIT 1 OFFSET $rand";
 
     my $sth    = $dbh->prepare($query);