Bug fixes to C code.

This commit is contained in:
krahets
2023-11-01 05:14:22 +08:00
parent f7dd05e7a4
commit 355cc3a6b1
31 changed files with 246 additions and 219 deletions
+2 -2
View File
@@ -95,7 +95,7 @@ void showTrunks(Trunk *trunk) {
}
/* Help to print a binary tree, hide more details */
static void printTreeHelper(TreeNode *node, Trunk *prev, bool isLeft) {
static void printTreeHelper(TreeNode *node, Trunk *prev, bool isRight) {
if (node == NULL) {
return;
}
@@ -104,7 +104,7 @@ static void printTreeHelper(TreeNode *node, Trunk *prev, bool isLeft) {
printTreeHelper(node->right, trunk, true);
if (prev == NULL) {
trunk->str = "———";
} else if (isLeft) {
} else if (isRight) {
trunk->str = "/———";
prev_str = " |";
} else {