From 19dc5f9c3710ab6066bdf0d59adee5589278f5be Mon Sep 17 00:00:00 2001 From: timriker Date: Mon, 28 Jun 2004 18:25:51 +0000 Subject: [PATCH] off by one? git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@961 c11ca15a-4712-0410-83d8-924469b57eb5 --- src/dbi.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dbi.pl b/src/dbi.pl index b0abee1..138c5cc 100644 --- a/src/dbi.pl +++ b/src/dbi.pl @@ -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); -- 2.39.2