From 232a8d01d98c9b4a00ae54970d716c187c088aa6 Mon Sep 17 00:00:00 2001
From: "remi.greub" <remi.greub@hes-so.ch>
Date: Fri, 4 Apr 2025 22:15:06 +0200
Subject: [PATCH] correction erreur sanitizer lorsque je lance avec mode > 3

---
 puissance4_GRB/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/puissance4_GRB/main.c b/puissance4_GRB/main.c
index 735f13b..294b24b 100644
--- a/puissance4_GRB/main.c
+++ b/puissance4_GRB/main.c
@@ -21,16 +21,18 @@ int main(int argc, char** argv){
 
     printf("Board size is %dx%d (rows x col)\n",height,width);
     struct game game;
-    init_puissance4(&game, height, width);
     switch (mode)
     {
         case 1:
+            init_puissance4(&game, height, width);
             Launch_puissance4_randBot(&game, 0);
         break;
         case 2:
+            init_puissance4(&game, height, width);
             Launch_puissance4_smartBot(&game, 0);
         break;
         case 3:
+            init_puissance4(&game, height, width);
             Launch_puissance4(&game);
         break;
         
-- 
GitLab