Add missing indexing on initialization
authorLukas Jiriste <ljiriste@student.42prague.com>
Tue, 19 Mar 2024 10:32:07 +0000 (11:32 +0100)
committerLukas Jiriste <ljiriste@student.42prague.com>
Tue, 19 Mar 2024 10:32:07 +0000 (11:32 +0100)
philo/main.c

index 4a991cd03096245885443502a2a7dc9634714e00..800b8f9340a81b5e7cb811cbc20acbe04245e2fb 100644 (file)
@@ -6,7 +6,7 @@
 /*   By: ljiriste <marvin@42.fr>                    +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   Created: 2024/03/05 12:49:40 by ljiriste          #+#    #+#             */
-/*   Updated: 2024/03/19 11:29:49 by ljiriste         ###   ########.fr       */
+/*   Updated: 2024/03/19 11:31:32 by ljiriste         ###   ########.fr       */
 /*                                                                            */
 /* ************************************************************************** */
 
@@ -137,7 +137,7 @@ t_philo     *build_philos(pthread_mutex_t *forks, t_settings *set)
        {
                --count;
                philos[count].id = count + 1;
-               philos->times_eaten = 0;
+               philos[count].times_eaten = 0;
                philos[count].settings = set;
                philos[count].forks[0] = forks + count - count % 2;
                if (count > 0)