Modif affichage entrée utilisateur

This commit is contained in:
rick 2021-02-16 20:19:00 +01:00
parent a6387a2d89
commit d11457ec63
Signed by: Rick
GPG key ID: 2B593F087240EE99

View file

@ -19,12 +19,11 @@ char* get_input()
{
char *buffer = (char *) malloc(MAX_LENGTH);
memset(buffer, 0, MAX_LENGTH);
buffer[0] = '\n';
printf("\n> ");
fgets(buffer, MAX_LENGTH, stdin);
while (buffer[0] == '\n')
{
printf("\n> ");
printf("> ");
fgets(buffer, MAX_LENGTH, stdin);
}
buffer[strlen(buffer)-1] = '\0'; /* pour ne pas avoir un retour à la ligne */