Sync with portableproplib-0.6.8.

This commit is contained in:
Juan RP
2019-06-03 17:55:15 +02:00
committed by Duncan Overbruck
parent 121d0fbb64
commit 371be9703e
6 changed files with 21 additions and 20 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: rb.c,v 1.9 2010/11/17 13:19:32 tron Exp $ */
/* $NetBSD: rb.c,v 1.14 2019/03/08 09:14:54 roy Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -123,7 +123,7 @@ rb_tree_find_node_geq(struct rb_tree *rbt, const void *key)
parent = parent->rb_nodes[diff < 0];
}
return RB_NODETOITEM(rbto, last);
return last == NULL ? NULL : RB_NODETOITEM(rbto, last);
}
void *
@ -144,7 +144,7 @@ rb_tree_find_node_leq(struct rb_tree *rbt, const void *key)
parent = parent->rb_nodes[diff < 0];
}
return RB_NODETOITEM(rbto, last);
return last == NULL ? NULL : RB_NODETOITEM(rbto, last);
}
void *