From 3c0ce892a9faf700f8133c156d2186c8ae573742 Mon Sep 17 00:00:00 2001 From: zenon Date: Fri, 8 Jun 2018 11:35:59 +0200 Subject: [PATCH] Loop until MAX_ITEMS and not bestSolutionLength --- supervisor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supervisor.c b/supervisor.c index 385acc7..9fb3be7 100644 --- a/supervisor.c +++ b/supervisor.c @@ -137,11 +137,11 @@ void getSolution(sem_t *sUsedSpace, sem_t *sFreeSpace) if (newSolutionLength < bestSolutionLength) { // Set all entries of bestSolution to -1 - for (int i = 0; i < bestSolutionLength; i++) { + for (int i = 0; i < MAX_ITEMS; i++) { bestSolution[i] = -1; } // Copy all entries from solution to bestSolution - for (int i = 0; i < newSolutionLength; i++) { + for (int i = 0; i < MAX_ITEMS; i++) { bestSolution[i] = solution[i]; }