tree printer BUGFIX print subtree segfault.
diff --git a/src/printer_tree.c b/src/printer_tree.c
index 41c55aa..c93bbc2 100644
--- a/src/printer_tree.c
+++ b/src/printer_tree.c
@@ -783,6 +783,7 @@
 {
     unsigned int depth, i, j;
     int level = 0;
+    uint16_t max_child_len;
     const struct lys_node *parent;
 
     /* learn the depth of the node */
@@ -823,7 +824,8 @@
     }
 
     /* print the node and its descendants */
-    tree_print_snode(out, level, 0, node, LYS_ANY, NULL, 2, opts);
+    max_child_len = tree_get_max_name_len(node, NULL, LYS_LEAF|LYS_LEAFLIST|LYS_ANYDATA, opts);
+    tree_print_snode(out, level, max_child_len, node, LYS_ANY, NULL, 2, opts);
 }
 
 static int