Fix segfault

master
Jade VAN BRABANDT 3 years ago
parent f015f76cb0
commit c17ca973e3

Binary file not shown.

@ -0,0 +1,5 @@
A
6
Yann

@ -7,7 +7,7 @@ prog :
EXE : EXE :
rm -f SAE rm -f SAE
gcc -o SAE src/saeMain.o src/annexe/saeAnnexe.o src/partie1/saeP1.o src/partie2/saeP2.o src/partie3/saeP3.o src/partie4/saeP4.o gcc -g -o SAE src/saeMain.o src/annexe/saeAnnexe.o src/partie1/saeP1.o src/partie2/saeP2.o src/partie3/saeP3.o src/partie4/saeP4.o
doc : doc :
make -C src doc make -C src doc

@ -1,7 +1,7 @@
all : saeP1.o all : saeP1.o
saeP1.o : saeP1.c saeP1.h saeP1.o : saeP1.c saeP1.h
gcc -Wall -c saeP1.c gcc -Wall -Werror -Wextra -g -c saeP1.c
doc : saeP1.h doc : saeP1.h
doxygen doxygen

@ -23,6 +23,10 @@ void menuUser(VilleIUT* lvIUT[],int tlogi)
printf("2 : Afficher tout les départements de chaques IUT\n"); printf("2 : Afficher tout les départements de chaques IUT\n");
printf("3 : Afficher le nombre de place en première année d'un IUT précis avec un département précis\n"); printf("3 : Afficher le nombre de place en première année d'un IUT précis avec un département précis\n");
printf("4 : Rechercher les IUTs possèdant un département précis.\n"); printf("4 : Rechercher les IUTs possèdant un département précis.\n");
/*if(CandidOpen)
{
printf("5 : Candidater");
}*/
printf("9 : Revenir à l'écran de sélection du profil.\n\n"); printf("9 : Revenir à l'écran de sélection du profil.\n\n");
printf("#--------------------------------------------------------------------#\n\n"); printf("#--------------------------------------------------------------------#\n\n");
printf("Choisissez l'action que vous voulez exécuter : "); printf("Choisissez l'action que vous voulez exécuter : ");
@ -45,6 +49,10 @@ void menuUser(VilleIUT* lvIUT[],int tlogi)
SearchIUTFromDep(lvIUT,tlogi); SearchIUTFromDep(lvIUT,tlogi);
reset(); reset();
break; break;
case 5:
//candidater(......);
reset();
break;
case 9: case 9:
quit=1; quit=1;
reset(); reset();
@ -79,18 +87,18 @@ void SearchPlaceFromDepInIUT(VilleIUT* lvIUT[],int tlogi)
int boolF=0, i; int boolF=0, i;
printf("Entrez le nom de la ville contenant le département recherché :\n"); printf("Entrez le nom de la ville contenant le département recherché :\n");
scanf("%s",sVille); scanf("%s",sVille);
printf("%d",tlogi);
for (i=0;i<tlogi;++i) for (i=0;i<tlogi;++i)
{ {
if (!strcmp(lvIUT[i]->Ville,sVille)) if (!strcmp(lvIUT[i]->Ville,sVille))
{ {
printf("Département y étant disponible :\n"); printf("Département y étant disponible :\n");
MaillonDep* MaillonAct=lvIUT[i]->ldept; MaillonDep* MaillonAct=lvIUT[i]->ldept;
printf("Test"); while (MaillonAct!=NULL)
while (MaillonAct!=NULL) printf("%s",MaillonAct->departement); {
printf("Test"); printf("\t-%s\n",MaillonAct->departement);
boolF=1;
MaillonAct=MaillonAct->suivant; MaillonAct=MaillonAct->suivant;
}
boolF=1;
break; break;
} }
} }
@ -105,7 +113,7 @@ void SearchPlaceFromDepInIUT(VilleIUT* lvIUT[],int tlogi)
while (MaillonAct!=NULL) while (MaillonAct!=NULL)
{ {
if(strcmp(MaillonAct->departement,sDep)) if(!strcmp(MaillonAct->departement,sDep))
{ {
printf("Nombre de place : %d\n",MaillonAct->nbp); printf("Nombre de place : %d\n",MaillonAct->nbp);
return; return;
@ -120,6 +128,7 @@ void SearchIUTFromDep(VilleIUT* lvIUT[],int tlogi)
char sDep[31]; char sDep[31];
printf("Merci de renseignez le département dont vous cherchez les IUTs :\n"); printf("Merci de renseignez le département dont vous cherchez les IUTs :\n");
scanf("%s",sDep); scanf("%s",sDep);
printf("Tlogi : %d",tlogi);
for (int i=0;i<tlogi;++i) for (int i=0;i<tlogi;++i)
{ {

@ -154,5 +154,10 @@ void ListeCandidat(int nbcandidat,candidat *tcandidat)
printf("Candidat non trouvé"); printf("Candidat non trouvé");
} }
//void gestionPhaseCandidatures(); A FAIRE. void Candidater()
{
}
//void gestionPhaseCandidatures(); A FAIRE.

@ -18,7 +18,7 @@ typedef struct
}candidat; }candidat;
candidat* LoadCandid(void); candidat* LoadCandid(void);
void SaveCandid(int nbcandidat,candidat *tcandidat) void SaveCandid(int nbcandidat,candidat *tcandidat);
void RechercheCandidat(int ID, int nbcandidat,candidat* tcandidat); void RechercheCandidat(int ID, int nbcandidat,candidat* tcandidat);
void ListeCandidat(int nbcandidat,candidat *tcandidat); void ListeCandidat(int nbcandidat,candidat *tcandidat);
//void gestionPhaseCandidatures(); A FAIRE. //void gestionPhaseCandidatures(); A FAIRE.

Loading…
Cancel
Save