summaryrefslogtreecommitdiff
path: root/source3/ubiqx/ubi_BinTree.c
diff options
context:
space:
mode:
authorChristopher R. Hertel <crh@samba.org>1998-10-21 19:00:44 +0000
committerChristopher R. Hertel <crh@samba.org>1998-10-21 19:00:44 +0000
commit8c307cee7a687da965c9b03ff19dd9de2eaabe64 (patch)
treea47ebdfc66b2f955f0540d4b070a2538a4a6624c /source3/ubiqx/ubi_BinTree.c
parent5b7df7a7529f28c21addf7666bc2106ed2848990 (diff)
downloadsamba-8c307cee7a687da965c9b03ff19dd9de2eaabe64.tar.gz
samba-8c307cee7a687da965c9b03ff19dd9de2eaabe64.tar.bz2
samba-8c307cee7a687da965c9b03ff19dd9de2eaabe64.zip
I received a bug report from Massimo Campostrini in Pisa. There are a pair
of "front-end" functions with the same bug each. Fixed. (This used to be commit 487a2e13b7913e512fa01e736daaccc3858eb689)
Diffstat (limited to 'source3/ubiqx/ubi_BinTree.c')
-rw-r--r--source3/ubiqx/ubi_BinTree.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/source3/ubiqx/ubi_BinTree.c b/source3/ubiqx/ubi_BinTree.c
index 62d17d5255..4e96c1d0ac 100644
--- a/source3/ubiqx/ubi_BinTree.c
+++ b/source3/ubiqx/ubi_BinTree.c
@@ -26,7 +26,14 @@
*
* -------------------------------------------------------------------------- **
*
- * Log: ubi_BinTree.c,v
+ * Log: ubi_BinTree.c,v
+ * Revision 4.7 1998/10/21 06:14:42 crh
+ * Fixed bugs in FirstOf() and LastOf() reported by Massimo Campostrini.
+ * See function comments.
+ *
+ * Revision 4.6 1998/07/25 17:02:10 crh
+ * Added the ubi_trNewTree() macro.
+ *
* Revision 4.5 1998/06/04 21:29:27 crh
* Upper-cased defined constants (eg UBI_BINTREE_H) in some header files.
* This is more "standard", and is what people expect. Weird, eh?
@@ -155,9 +162,9 @@
*/
static char ModuleID[] = "ubi_BinTree\n\
-\tRevision: 4.5 \n\
-\tDate: 1998/06/04 21:29:27 \n\
-\tAuthor: crh \n";
+\tRevision: 4.7\n\
+\tDate: 1998/10/21 06:14:42\n\
+\tAuthor: crh\n";
/* ========================================================================== **
* Internal (private) functions.
@@ -899,11 +906,15 @@ ubi_btNodePtr ubi_btFirstOf( ubi_btRootPtr RootPtr,
* matching <FindMe>.
* Notes: Node *p MUST be in the set of nodes with keys matching
* <FindMe>. If not, this function will return NULL.
+ *
+ * 4.7: Bug found & fixed by Massimo Campostrini,
+ * Istituto Nazionale di Fisica Nucleare, Sezione di Pisa.
+ *
* ------------------------------------------------------------------------ **
*/
{
/* If our starting point is invalid, return NULL. */
- if( !p || ubi_trAbNormal( (*(RootPtr->cmp))( MatchMe, p ) != ubi_trEQUAL ) )
+ if( !p || (ubi_trEQUAL != ubi_trAbNormal( (*(RootPtr->cmp))( MatchMe, p ) )) )
return( NULL );
return( Border( RootPtr, MatchMe, p, ubi_trLEFT ) );
} /* ubi_btFirstOf */
@@ -924,11 +935,15 @@ ubi_btNodePtr ubi_btLastOf( ubi_btRootPtr RootPtr,
* matching <FindMe>.
* Notes: Node *p MUST be in the set of nodes with keys matching
* <FindMe>. If not, this function will return NULL.
+ *
+ * 4.7: Bug found & fixed by Massimo Campostrini,
+ * Istituto Nazionale di Fisica Nucleare, Sezione di Pisa.
+ *
* ------------------------------------------------------------------------ **
*/
{
/* If our starting point is invalid, return NULL. */
- if( !p || ubi_trAbNormal( (*(RootPtr->cmp))( MatchMe, p ) != ubi_trEQUAL ) )
+ if( !p || (ubi_trEQUAL != ubi_trAbNormal( (*(RootPtr->cmp))( MatchMe, p ) )) )
return( NULL );
return( Border( RootPtr, MatchMe, p, ubi_trRIGHT ) );
} /* ubi_btLastOf */