diff --git a/cv7/program.c b/cv7/program.c index 7fd12c5..9c5fbc9 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"); - node = NULL; // Exit the program if reading fails + return 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"); - node = NULL; + return NULL; } // Copy the input line into the node's value