From 9fd07842fe493d332684d1c4a4e57593e1ef3312 Mon Sep 17 00:00:00 2001
From: lpaucot_uclouvain <laurent.paucot@student.uclouvain.be>
Date: Thu, 19 Mar 2020 01:08:56 +0100
Subject: [PATCH] plus de segfault mais test.c pas ok

---
 expected_output.txt |  2 +-
 input.txt           |  2 +-
 run.c               |  2 ++
 test.c              | 10 +++++++---
 4 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/expected_output.txt b/expected_output.txt
index a3342e9..4da4b67 100644
--- a/expected_output.txt
+++ b/expected_output.txt
@@ -1,3 +1,3 @@
-20414363521583006011 283 72135560146936417
+14 2 7
 13
 100 2 5
diff --git a/input.txt b/input.txt
index 722daca..d2ffa86 100644
--- a/input.txt
+++ b/input.txt
@@ -1,3 +1,3 @@
-20414363521583006011
+14
 13
 100
diff --git a/run.c b/run.c
index 8cad8ac..729b0e2 100644
--- a/run.c
+++ b/run.c
@@ -63,6 +63,8 @@ queue_t* prime_divs(int number){
 
     struct queue new_queue;
     new_queue.size = 0;
+    new_queue.tail = malloc(sizeof(node_t));
+    if(new_queue.tail==NULL){return NULL;}
 
     struct queue *ptr;
     ptr = malloc(sizeof(queue_t));
diff --git a/test.c b/test.c
index b43e52e..7518c6e 100644
--- a/test.c
+++ b/test.c
@@ -39,13 +39,17 @@ void file_test(void){
     return;
     }
 
-    char chaine1[50];
+    CU_ASSERT_PTR_EQUAL(file1,file2);
+
+    /* char chaine1[50];
     char chaine2[50];
 
     while (fgets(chaine1,50,file1) != NULL && fgets(chaine2,50,file2) != NULL)
     {
-        CU_ASSERT_STRING_EQUAL(chaine1,chaine2);
-    }
+        printf(chaine1);
+        printf(chaine2);
+        CU_ASSERT_PTR_EQUAL(chaine1,chaine2);
+    } */
 
     fclose(file1);
     fclose(file2);
-- 
GitLab