From bf7b86398a99b1f9eea59f10daf00b8dee111502 Mon Sep 17 00:00:00 2001 From: Dominik Kaiser Date: Mon, 27 Jan 2025 14:37:55 +0100 Subject: Outsource eating and fix norme again --- philo/src/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'philo/src/main.c') diff --git a/philo/src/main.c b/philo/src/main.c index c455f0d..a43fe8d 100644 --- a/philo/src/main.c +++ b/philo/src/main.c @@ -6,7 +6,7 @@ /* By: dkaiser time_to_eat = ft_atoi(argv[3]); data->time_to_sleep = ft_atoi(argv[4]); if (argc == 6) + { data->times_must_eat = ft_atoi(argv[5]); + if (data->times_must_eat < 1) + return (ft_err("times_must_eat can't be negative or zero")); + } else data->times_must_eat = -1; if (data->nbr_of_philos <= 0) -- cgit v1.2.3