Skip to content
Snippets Groups Projects
Commit abecac7a authored by Roman Tokarev's avatar Roman Tokarev
Browse files

[sptree] fix initialization from array of one element

parent fcb87124
No related merge requests found
......@@ -144,6 +144,8 @@ sptree_##name##_init(sptree_##name *t, elemtype *m,
\
if (t->nmember == 1) { \
t->root = 0; \
_SET_SPNODE_RIGHT(0, SPNIL); \
_SET_SPNODE_LEFT(0, SPNIL); \
} else if (t->nmember > 1) { \
qsort_arg(t->members, t->nmember, sizeof(elemtype), t->compare, t->arg); \
/* create tree */ \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment