diff options
-rw-r--r-- | nodelink.c | 4 | ||||
-rw-r--r-- | read.c | 2 |
2 files changed, 4 insertions, 2 deletions
@@ -1,5 +1,6 @@ #include <stdlib.h> #include <stdio.h> +#include <string.h> #include "nodelink.h" #include "strbst.h" @@ -29,7 +30,8 @@ static void printeach(strbstnode* loc, char reprint) { // loc->ind is the name of the connection and loc->data the link if (!reprint) printf(" "); // indent on subnode printlink(loc->ind, loc->data); // prints it - if (reprint) { // and their subnodes if iterating over root tree + // and subnodes if iterating over root tree (except root link) + if (reprint && strcmp(loc->ind,"root")) { // prints the link's target's link tree printeach( ( (link*)loc->data)->to->links->head, 0); } @@ -94,7 +94,7 @@ node* readfile(char* name) { FILE* read = fopen(name, "r"); node *root, *cur; cur = root = newnode(); - link* curl = addbstlink(root->links, name, root); + link* curl = addbstlink(root->links, "root", root); llnode start; start.next = NULL; // empty desc isn't undefined |