Modif affichage entrée utilisateur
This commit is contained in:
parent
a6387a2d89
commit
d11457ec63
1 changed files with 2 additions and 3 deletions
|
@ -19,12 +19,11 @@ char* get_input()
|
||||||
{
|
{
|
||||||
char *buffer = (char *) malloc(MAX_LENGTH);
|
char *buffer = (char *) malloc(MAX_LENGTH);
|
||||||
memset(buffer, 0, MAX_LENGTH);
|
memset(buffer, 0, MAX_LENGTH);
|
||||||
|
buffer[0] = '\n';
|
||||||
|
|
||||||
printf("\n> ");
|
|
||||||
fgets(buffer, MAX_LENGTH, stdin);
|
|
||||||
while (buffer[0] == '\n')
|
while (buffer[0] == '\n')
|
||||||
{
|
{
|
||||||
printf("\n> ");
|
printf("> ");
|
||||||
fgets(buffer, MAX_LENGTH, stdin);
|
fgets(buffer, MAX_LENGTH, stdin);
|
||||||
}
|
}
|
||||||
buffer[strlen(buffer)-1] = '\0'; /* pour ne pas avoir un retour à la ligne */
|
buffer[strlen(buffer)-1] = '\0'; /* pour ne pas avoir un retour à la ligne */
|
||||||
|
|
Loading…
Reference in a new issue