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 * aSup = rechercheElemListe(*listeArticle);
|
||||||
ListeArticle * tmp = *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;
|
ListeArticle * aFree = aSup->suite;
|
||||||
memcpy(aSup, aSup->suite, sizeof(ListeArticle));
|
memcpy(aSup, aSup->suite, sizeof(ListeArticle));
|
||||||
free(aFree);
|
free(aFree);
|
||||||
aFree = NULL;
|
aFree = NULL;
|
||||||
}
|
}
|
||||||
else if(aSup == *listeArticle)
|
else if(aSup == *listeArticle)//Premier et pas de suite
|
||||||
{
|
{
|
||||||
free(*listeArticle);
|
free(*listeArticle);
|
||||||
*listeArticle = NULL;
|
*listeArticle = NULL;
|
||||||
}
|
}
|
||||||
else
|
else//Pas de suite, recherche precdent pour que precdent->suite = NULL
|
||||||
{
|
{
|
||||||
for(;tmp->suite != aSup && tmp;tmp = tmp->suite);
|
for(;tmp->suite != aSup && tmp;tmp = tmp->suite);
|
||||||
if(tmp){
|
if(tmp){
|
||||||
|
|
Loading…
Reference in New Issue