cv7
This commit is contained in:
parent
ef5fd01176
commit
31cd3999f2
@ -15,7 +15,7 @@ struct tree
|
|||||||
struct tree* read_tree()
|
struct tree* read_tree()
|
||||||
{
|
{
|
||||||
char buffer[SIZE];
|
char buffer[SIZE];
|
||||||
if (!fgets(buffer, SIZE, stdin) || buffer[0] == '\n')
|
if (!fgets(buffer, SIZE, stdin) || buffer[0] == '\n' || buffer[0] == '\0')
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -136,6 +136,11 @@ void interact(struct tree *node, int fstenter)
|
|||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
struct tree *root = read_tree();
|
struct tree *root = read_tree();
|
||||||
|
if(root == NULL)
|
||||||
|
{
|
||||||
|
printf("Chybna databaza\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
//getchar();
|
//getchar();
|
||||||
int leafs = count_leaf_nodes(root);
|
int leafs = count_leaf_nodes(root);
|
||||||
if(leafs == 0)
|
if(leafs == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user