diff --git a/src/panier.c b/src/panier.c index ff35784..b5978b3 100644 --- a/src/panier.c +++ b/src/panier.c @@ -136,6 +136,11 @@ void basket_add(int tab_reference[], float unitPrice[], float *cagnotte, int ba { int i, ref_to_add, qte_to_add, trouve, index_ajout; float total_weight[tmaxArticles], total_volume[tmaxArticles], total_price[tmaxArticles], total_cagnotte[tmaxArticles]; + if (tlogItem+1>tmaxArticles) + { + printf("erreur, pas assez de place pour ajouter un autre article"); + return; + } printf("Quelle référence souhaitez-vous ajouter au panier?"); scanf("%d", &ref_to_add); index_ajout = searchTab(tab_reference, ref_to_add, tlogItem, &trouve);