summaryrefslogtreecommitdiff
path: root/cord/cordbscs.c
diff options
context:
space:
mode:
Diffstat (limited to 'cord/cordbscs.c')
-rw-r--r--cord/cordbscs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/cord/cordbscs.c b/cord/cordbscs.c
index 9fc894d..d83f406 100644
--- a/cord/cordbscs.c
+++ b/cord/cordbscs.c
@@ -219,7 +219,7 @@ CORD CORD_cat_char_star(CORD x, const char * y, size_t leny)
result->len = result_len;
result->left = x;
result->right = y;
- if (depth > MAX_DEPTH) {
+ if (depth >= MAX_DEPTH) {
return(CORD_balance((CORD)result));
} else {
return((CORD) result);
@@ -260,7 +260,11 @@ CORD CORD_cat(CORD x, CORD y)
result->len = result_len;
result->left = x;
result->right = y;
- return((CORD) result);
+ if (depth >= MAX_DEPTH) {
+ return(CORD_balance((CORD)result));
+ } else {
+ return((CORD) result);
+ }
}
}