ajout commentaire suprimerElemListeArticle

This commit is contained in:
adriy 2017-05-12 12:59:33 +00:00
parent 044fef6af0
commit 5c55c3e483
1 changed files with 3 additions and 3 deletions

View File

@ -1080,19 +1080,19 @@ void suprimerElemListeArticle(ListeArticle ** listeArticle)
{
ListeArticle * aSup = rechercheElemListe(*listeArticle);
ListeArticle * tmp = *listeArticle;
if(aSup->suite)
if(aSup->suite)//Elem au millieux ou premier mais il y a ye suite
{
ListeArticle * aFree = aSup->suite;
memcpy(aSup, aSup->suite, sizeof(ListeArticle));
free(aFree);
aFree = NULL;
}
else if(aSup == *listeArticle)
else if(aSup == *listeArticle)//Premier et pas de suite
{
free(*listeArticle);
*listeArticle = NULL;
}
else
else//Pas de suite, recherche precdent pour que precdent->suite = NULL
{
for(;tmp->suite != aSup && tmp;tmp = tmp->suite);
if(tmp){