title: Display issue in C with pointer and structur from excel values
body: <p>I'm encountering an issue when i run my program. Indeed, i can't correctly display each fetched variables from my excel file (correctly encoded with UTF-8). This excel file only contains cities name. These names are stored in structures(Test here) which are in my pointer list named : "test_list". However, when i display these variables previously, they are correctly displayed.</p>
  
  <p>See below my simplified program and the out : </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  typedef struct Test Test;
  
  const nbr_villes = 23;
  
  struct Test
  {
      char* nom;
  };
  
  Test *init_test(char *nom) {
  
      Test *test = malloc(sizeof(Test));
      test-&gt;nom = nom;
  
      return test;
  }
  
  void fill_test(Test **test_list)
  {
      FILE *csv_file = fopen("villes.csv", "r");
  
      char line[1024];
  
      // remove header "Ville"
      fgets(line, 0, csv_file);
  
      for (int i = 0 ; i &lt; nbr_villes ; i++)
      {
          fgets(line, 1024, csv_file);
          char *tmp = strdup(line);
          printf("%s\n", tmp);
          test_list[i] = init_test(tmp);
          free(tmp);
      }
  }
  
  int main()
  {
      // 23 éléments dans liste de test
      Test **test_list = malloc(nbr_villes * sizeof(struct Test));
      fill_test(test_list);
  
      for (int i = 0; i &lt; nbr_villes; i++){
          printf("%s\n",test_list[i]-&gt;nom);
      }
  }
  </code></pre>
  
  <p>and the out : </p>
  
  <pre><code>(prints of tmp :)
  
  ville
  
  Amiens
  
  Bayonne
  
  Bordeaux
  
  Bourges
  
  Caen
  
  Clermont-Ferrand
  
  Dijon
  
  Grenoble
  
  Le-Mans
  
  Lille
  
  Lyon
  
  Marseille
  
  Metz
  
  Montpellier
  
  Nantes
  
  Nice
  
  Niort
  
  Paris
  
  Reims
  
  Rennes
  
  Strasbourg
  
  Toulouse
  
  (Errors are here : prints in the main loop :)
  
  @f
  @f
  êf
  êf
  êf
  êf
  ¿f
  ¿f
  ░f
  ░f
  ░f
  ░f
  ░f
  Metz
  
  ░f
  Rennes
  
  Ïf
  Niort
  
  pf
  hf
  Rennes
  
  Strasbourg
  
  Toulouse
  </code></pre>
  
  <p>Thank you for the help. </p>