Initialize variables in splay_tree.c - splay_top_down()
This commit is contained in:
parent
044fc684d0
commit
9e0c77e21f
1 changed files with 4 additions and 1 deletions
|
@ -25,11 +25,14 @@
|
||||||
/* Splay operation */
|
/* Splay operation */
|
||||||
|
|
||||||
static splay_node_t *splay_top_down(splay_tree_t *tree, const void *data, int *result) {
|
static splay_node_t *splay_top_down(splay_tree_t *tree, const void *data, int *result) {
|
||||||
splay_node_t left = {NULL}, right = {NULL};
|
splay_node_t left, right;
|
||||||
splay_node_t *leftbottom = &left, *rightbottom = &right, *child, *grandchild;
|
splay_node_t *leftbottom = &left, *rightbottom = &right, *child, *grandchild;
|
||||||
splay_node_t *root = tree->root;
|
splay_node_t *root = tree->root;
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
|
memset(&left, 0x0, sizeof(splay_node_t));
|
||||||
|
memset(&right, 0x0, sizeof(splay_node_t));
|
||||||
|
|
||||||
if(!root) {
|
if(!root) {
|
||||||
if(result)
|
if(result)
|
||||||
*result = 0;
|
*result = 0;
|
||||||
|
|
Loading…
Reference in a new issue