diff --git a/cv8/program.c b/cv8/program.c index 242000a..e1bf72d 100644 --- a/cv8/program.c +++ b/cv8/program.c @@ -35,13 +35,19 @@ struct tree* read_tree(){ } void search(struct tree* this){ - + + char buffer[5]; memset(buffer,0,5); - char* r = fgets(buffer,5,stdin); + + if(fgets(buffer, 5, stdin) == NULL){ + printf("Koniec vstupu\n"); + return; + } + //char* r = fgets(buffer,5,stdin); int x = strlen(buffer); buffer[x-1]='\0'; - + if(buffer[0] == '\n'){ return; }