Commit 19dfca87 authored by chriseth's avatar chriseth

Bugfix for example contract

Discovered by @alexvandesande
parent dfa78c2a
...@@ -81,13 +81,11 @@ var BALLOT_EXAMPLE = multi(function(){/*contract Ballot { ...@@ -81,13 +81,11 @@ var BALLOT_EXAMPLE = multi(function(){/*contract Ballot {
function winningProposal() constant returns (uint8 winningProposal) { function winningProposal() constant returns (uint8 winningProposal) {
uint256 winningVoteCount = 0; uint256 winningVoteCount = 0;
for (uint8 proposal = 0; proposal < proposals.length; proposal++) { for (uint8 proposal = 0; proposal < proposals.length; proposal++)
if (proposals[proposal].voteCount > winningVoteCount) { if (proposals[proposal].voteCount > winningVoteCount) {
winningVoteCount = proposals[proposal].voteCount; winningVoteCount = proposals[proposal].voteCount;
winningProposal = proposal; winningProposal = proposal;
} }
++proposal;
}
} }
} }
*/}); */});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment