From e59185cd8de1e9b4095a9b0cf33c3de4b99da018 Mon Sep 17 00:00:00 2001 From: Lino Mastrodomenico Date: Sun, 8 Dec 2019 22:34:47 +0000 Subject: [PATCH] Fix another access outside array bounds. --- examples/example_3/src/ProductionCode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/example_3/src/ProductionCode.c b/examples/example_3/src/ProductionCode.c index 500b44b..3bafe20 100644 --- a/examples/example_3/src/ProductionCode.c +++ b/examples/example_3/src/ProductionCode.c @@ -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;