ajout commentaire suprimerElemListeArticle
This commit is contained in:
parent
044fef6af0
commit
5c55c3e483
|
@ -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){
|
||||
|
|
Loading…
Reference in New Issue