From 287fe5df13a7663db9c22ef7eb1c45ebf8c5ff5e Mon Sep 17 00:00:00 2001 From: Marian Ohligs Date: Mon, 19 Sep 2011 00:28:46 +0200 Subject: [PATCH] - fix bug --- newlib/examples/mshell.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; }