diff --git a/cv8/program.c b/cv8/program.c index 835536a..c34ee26 100644 --- a/cv8/program.c +++ b/cv8/program.c @@ -59,6 +59,10 @@ void ask(struct node* tree){ } char buff[SIZE]; char* r = fgets(buff, SIZE, stdin); + if(r == NULL){ + puts("Koniec vstupu"); + return; + } r = fgets(buff, SIZE, stdin); if(r[0] == 'a' && tree->left != NULL){ tree = tree->left;