From 9281e9f508ae711e05e30e48dc7db5577955f434 Mon Sep 17 00:00:00 2001 From: Camille Chauvet Date: Wed, 19 Apr 2023 14:02:44 +0000 Subject: [PATCH] fix: stop when philo dead --- main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index f915f7f..becc478 100644 --- a/main.c +++ b/main.c @@ -53,8 +53,8 @@ void check_routine(t_data *data) { if ((ssize_t) get_min_meal(data) == data->nb_meals) { - printf("g pu faim\n"); stop(data); + printf("g pu faim\n"); return ; } i = 0; @@ -67,6 +67,7 @@ void check_routine(t_data *data) if (ok == 1) { print_died(philo); + stop(data); return ; } i++; @@ -78,6 +79,7 @@ int main(int ac, char **av) { t_data data; + get_time(); if (parsing(&data, av + 1, ac - 1)) return (1); if (data_init(&data))