NOTE: The first element I am inserting out of the chi, this is the second on, the while will run until the user types the id of a student -1 q ta in the create function. It's falling into an infinite loop!
void inserir(Aluno *aluno){
while(1){
if(aluno->prox == NULL){
Aluno *aux = aluno;
Aluno *novo = criar();
if(novo->id < 0)
break;
aux->prox = novo;
novo->prox = aux;
}else{
Aluno *aux = aluno->prox;
while(aux->prox != aluno){ // entra e um loop infinito
printf("3\n");
aux = aux->prox;
}
Aluno *novo = criar();
if(novo->id < 0)
break;
aux->prox=novo;
novo->prox=aux;
}
}
}