TP6: Fix to the n ary tree.
[Algorithmic_C.git] / TP6 / arbres / arbre_n_aire / arbre_n_aire.c
index 7713d7218ae1ae1d6dce1b7446dabbf69ec7860e..678451771dfdc3b44a187b89d5f8be012fc98a2d 100644 (file)
@@ -61,7 +61,7 @@ NOEUD *insere(NOEUD * p, char *mot, int i)
     if (p == NULL) {
        return insere_fin(mot, i);
     } else if (p->lettre == mot[i]) {
-       if (mot[i]) {
+       if (mot[i] != '\0') {
            p->fils = insere(p->fils, mot, i + 1);
        } else {
            printf("The word is already here\n");
@@ -76,7 +76,6 @@ NOEUD *insere(NOEUD * p, char *mot, int i)
     return p;
 }
 
-
 /*****************************************************************************/
 /* Affichage par ordre alphabetique de tous les mots stockes dans l'arbre    */
 void affiche(NOEUD * p, char *mot, int i)