diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/path.c | 7 | ||||
-rw-r--r-- | src/tree.c | 2 |
2 files changed, 5 insertions, 4 deletions
@@ -356,10 +356,9 @@ zix_path_lexically_normal(ZixAllocator* const allocator, const char* const path) size_t last = r; size_t next = 0; for (size_t i = root_len; i < r;) { - if (last < r && i > 2 && i + 1 <= r && result[i - 2] == sep && - result[i - 1] == '.' && result[i] == '.' && - (!result[i + 1] || is_dir_sep(result[i + 1]))) { - if (i < r && result[i + 1] == sep) { + if (last < r && i > 2U && result[i - 2U] == sep && result[i - 1U] == '.' && + result[i] == '.' && (!result[i + 1U] || is_dir_sep(result[i + 1U]))) { + if (result[i + 1] == sep) { ++i; } @@ -507,6 +507,8 @@ zix_tree_remove(ZixTree* t, ZixTreeIter* ti) t->root = replace; } + assert(n->left); + replace->parent = n->parent; replace->left = n->left; n->left->parent = replace; |