I am coding a range function for a BST, can some one help me with what I'm doing wrong here?

Code:

typedef int data_t;
typedef struct bnode bstree_t;
struct bnode
{
data_t data;
bstree_t *left;
bstree_t *right;
};
/*aux functions*/
int cmp (data_t x, data_t y)
{
if (x < y)
return-1;
else if (x > y)
return 1;
else
return 0;
}
int within_range (data_t value, data_t low, data_t hi)
{
if (((cmp (value, low)) >= 0) && ((cmp (value, hi)) <= 0))
return 1;
else
return 0;
}
/*range function*/
int in_range (bstree_t *tree, data_t low, data_t hi)
{
if (tree == NULL)
{
return 0;
}
else
{
if (within_range (tree->data, low, hi))
{
int counter = 1;
counter += in_range (tree->left, low, hi);
counter += in_range (tree->right, low, hi);
return counter;
}
else
{
if (cmp (tree->data, low) > 0)
{
in_range (tree->left, low, hi);
}
else if (cmp (tree->data, hi) < 0)
{
in_range (tree->right, low, hi);
}
}
}
}