# HG changeset patch # User vitor # Date 1236706696 0 # Node ID 678152bdb3a167f77623c6ed9e990ad3b0dc7ea1 # Parent 7a9a124bbc069ceb9b98896b64b4a3e1791b45b6 Fix bug when elbg->utility_inc[elbg->numCB-1] == 1 diff -r 7a9a124bbc06 -r 678152bdb3a1 elbg.c --- a/elbg.c Tue Mar 10 14:35:55 2009 +0000 +++ b/elbg.c Tue Mar 10 17:38:16 2009 +0000 @@ -105,7 +105,7 @@ { int i=0; /* Using linear search, do binary if it ever turns to be speed critical */ - int r = av_lfg_get(elbg->rand_state)%(elbg->utility_inc[elbg->numCB-1]-1) + 1; + int r = av_lfg_get(elbg->rand_state)%elbg->utility_inc[elbg->numCB-1] + 1; while (elbg->utility_inc[i] < r) i++;