diff --git a/runoff.c b/runoff.c index fc964ef..66cb6cb 100644 --- a/runoff.c +++ b/runoff.c @@ -146,9 +146,10 @@ void tabulate(void) { for (int j = 0; j < candidate_count; j++) { - if (preferences[i][0] == j && !candidates[j].eliminated) + if (candidates[preferences[i][j]].eliminated == false) { - candidates[j].votes++; + candidates[preferences[i][j]].votes++; + break; } } }