From e895d49e1a226872e0594c19f8c559c82da089b3 Mon Sep 17 00:00:00 2001 From: Viktor Daniv Date: Fri, 15 Nov 2024 01:13:12 +0000 Subject: [PATCH] Update cv7/program.c --- cv7/program.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cv7/program.c b/cv7/program.c index 6f45b80..7fd12c5 100644 --- a/cv7/program.c +++ b/cv7/program.c @@ -83,14 +83,14 @@ struct tree* read_tree() { char* r = fgets(buffer, SIZE, stdin); if (r == NULL) { // fprintf(stderr, "Chybna databaza\n"); - exit(1); // Exit the program if reading fails + node = NULL; // Exit the program if reading fails } // Allocate memory for a new tree node struct tree* node = calloc(1, sizeof(struct tree)); if (!node) { - printf("Memory allocation failed!\n"); - exit(1); + //printf("Memory allocation failed!\n"); + node = NULL; } // Copy the input line into the node's value