diff --git a/mandatory/philo.h b/mandatory/philo.h index c489198..7ee2e5a 100644 --- a/mandatory/philo.h +++ b/mandatory/philo.h @@ -42,7 +42,8 @@ typedef struct s_same typedef struct s_only { - int *id; + int id; + int eat; } t_only; typedef struct s_philo diff --git a/mandatory/threads.c b/mandatory/threads.c index e9eeaae..fd58de3 100644 --- a/mandatory/threads.c +++ b/mandatory/threads.c @@ -155,12 +155,10 @@ t_same *create_struct_same(t_config *config) t_only *create_struct_only(int id) { t_only *only; - int *id_alloc; only = ft_calloc(sizeof(t_only), 1); - id_alloc = ft_calloc(sizeof(int), 1); - *id_alloc = id; - only->id = id_alloc; + only->id = id; + only->eat = 0; return (only); }