Skip to content

Commit

Permalink
Fix another access outside array bounds.
Browse files Browse the repository at this point in the history
  • Loading branch information
LinoMastro committed Dec 8, 2019
1 parent 86caf7e commit e59185c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/example_3/src/ProductionCode.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ int NumbersToFind[9] = { 0, 34, 55, 66, 32, 11, 1, 77, 888 }; //some obnoxious a
int FindFunction_WhichIsBroken(int NumberToFind)
{
int i = 0;
while (i <= 8) //Notice I should have been in braces
while (i < 8) //Notice I should have been in braces
i++;
if (NumbersToFind[i] == NumberToFind) //Yikes! I'm getting run after the loop finishes instead of during it!
return i;
Expand Down

0 comments on commit e59185c

Please sign in to comment.