From: timriker Date: Mon, 28 Jun 2004 18:25:51 +0000 (+0000) Subject: off by one? X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=8ccda06d04d78bdff6e02fb3860a137817ac9fc9;p=infobot.git off by one? git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@961 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/blootbot/src/dbi.pl b/blootbot/src/dbi.pl index b0abee1..138c5cc 100644 --- a/blootbot/src/dbi.pl +++ b/blootbot/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);