about summary refs log tree commit diff
path: root/src/search/tsearch_avl.c
Commit message (Collapse)AuthorAgeFilesLines
* fix tsearch, tfind, tdelete to handle null pointer inputSzabolcs Nagy2015-12-081-0/+6
| | | | | POSIX specifies the behaviour for null rootp input, but it was not implemented correctly.
* tsearch code cleanupSzabolcs Nagy2015-12-081-24/+28
| | | | | changed the insertion method to simplify the recursion logic and reduce code size a bit.
* fix tsearch to avoid crash on oomSzabolcs Nagy2015-12-081-1/+1
| | | | | malloc failure was not properly propagated in the insertion method which led to null pointer dereference.
* fix tdelete to properly balance the treeSzabolcs Nagy2015-12-081-5/+14
| | | | | | | the tsearch data structure is an avl tree, but it did not implement the deletion operation correctly so the tree could become unbalanced. reported by Ed Schouten.
* fix aliasing violations in tsearch functionsRich Felker2013-08-021-2/+10
| | | | | | | patch by nsz. the actual object the caller has storing the tree root has type void *, so accessing it as struct node * is not valid. instead, simply access the value, move it to a temporary of the appropriate type and work from there, then move the result back.
* search: add comments to tsearch_avl.cnsz2012-05-131-0/+6
|
* XSI search.h API implementation by Szabolcs NagyRich Felker2011-06-251-0/+171