From 07979c05dd2a77ec86a43a6b2b10809a1d18ff9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20LAVERGNE?= Date: Wed, 8 Nov 2023 15:10:47 +0100 Subject: [PATCH] =?UTF-8?q?Correction=20de=20probl=C3=A8me=20de=20duplicat?= =?UTF-8?q?ion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.c | 2 +- src/traitement.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 564fecd..89b1fe8 100644 --- a/src/main.c +++ b/src/main.c @@ -52,7 +52,7 @@ void global(void) +var cagnotte: tableau des cagnottes des clients */ // Déclaration des variables - int tLogArticle, tLogClient, choice, status, currentUser, clientPassword; + int tLogArticle, tLogClient, choice, status, currentUser; int reference[tmaxArticles], clientID[tmaxClients], clientPassword[tmaxClients], suspended[tmaxClients], isAdmin[tmaxClients]; float weight[tmaxArticles], volume[tmaxArticles], unitPrice[tmaxArticles], cagnotte[tmaxClients]; // Chargement de toute les données diff --git a/src/traitement.c b/src/traitement.c index 3492cbd..02f7176 100644 --- a/src/traitement.c +++ b/src/traitement.c @@ -166,8 +166,11 @@ void sauvegardeArticles(int reference[], float weight[], float volume[], float u { errorHandling(-5); } -printf("ERREUR: Echec de l'ouverture en écriture de 'clients.txt'.\n"); - exit(1);%f\n", reference[i], weight[i], volume[i], unitPrice[i]); + + int i; + for(i=0; i