From cf06b0818f5c0a0881ebaa0d25a54ab3698765e4 Mon Sep 17 00:00:00 2001 From: vj586da Date: Fri, 26 Nov 2021 03:03:26 +0100 Subject: [PATCH] Koniec vstupu --- cv8/program.c | 4 ++++ 1 file changed, 4 insertions(+) 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;