diff --git a/newlib/examples/mshell.c b/newlib/examples/mshell.c index c19de0c5..fbd777b2 100644 --- a/newlib/examples/mshell.c +++ b/newlib/examples/mshell.c @@ -42,13 +42,15 @@ int main(int argc, char** argv) { char* command = malloc(1024*sizeof(char)); - int size, status = 0; + int size = 0, status = 0; pid_t pid; system("clear"); showlogo(); while(1) { printf("$ "); - size = scanf("%s", command); + do { + size = scanf("%s", command); + } while(size <= 0); if(!strcmp(command, "exit")) { return 0; }