/*
* Yanked out of Net::Patricia by Aaron Sethman <androsyn@ratbox.org>
- *
+ *
* This was then yanked out of the ratbox/devel/src tree and stuffed into
* libratbox and had function names changed, but otherwise not really altered.
*
* Dave Plonka <plonka@doit.wisc.edu>
*
* This product includes software developed by the University of Michigan,
- * Merit Network, Inc., and their contributors.
+ * Merit Network, Inc., and their contributors.
*
* This file had been called "radix.c" in the MRT sources.
*
static char tmp[6];
if(prefix == NULL)
{
- strcpy(buf, "(NULL)");
+ rb_strlcpy(buf, "(NULL)", buf_len);
return (buf);
}
inet_ntop(prefix->family, &prefix->add.sin, buf, buf_len);
/* } */
-// #define PATRICIA_DEBUG 1
+// #define PATRICIA_DEBUG 1
static int num_active_patricia = 0;
prefix_toa(node->prefix), node->prefix->bitlen);
else
fprintf(stderr,
- "patricia_search_exact: take right at %d\n", node->bit);
+ "patricia_search_exact: take right at %u\n", node->bit);
#endif /* PATRICIA_DEBUG */
node = node->r;
}
prefix_toa(node->prefix), node->prefix->bitlen);
else
fprintf(stderr,
- "patricia_search_exact: take left at %d\n", node->bit);
+ "patricia_search_exact: take left at %u\n", node->bit);
#endif /* PATRICIA_DEBUG */
node = node->l;
}
#ifdef PATRICIA_DEBUG
if(node->prefix)
- fprintf(stderr, "patricia_search_exact: stop at %s/%d %d\n",
+ fprintf(stderr, "patricia_search_exact: stop at %s/%d %u\n",
prefix_toa(node->prefix), node->prefix->bitlen, node->bit);
else
- fprintf(stderr, "patricia_search_exact: stop at %d\n", node->bit);
+ fprintf(stderr, "patricia_search_exact: stop at %u\n", node->bit);
#endif /* PATRICIA_DEBUG */
if(node->bit > bitlen || node->prefix == NULL)
return (NULL);
prefix_toa(node->prefix), node->prefix->bitlen);
else
fprintf(stderr,
- "patricia_search_best: take right at %d\n", node->bit);
+ "patricia_search_best: take right at %u\n", node->bit);
#endif /* PATRICIA_DEBUG */
node = node->r;
}
prefix_toa(node->prefix), node->prefix->bitlen);
else
fprintf(stderr,
- "patricia_search_best: take left at %d\n", node->bit);
+ "patricia_search_best: take left at %u\n", node->bit);
#endif /* PATRICIA_DEBUG */
node = node->l;
}
fprintf(stderr, "patricia_search_best: stop at %s/%d\n",
prefix_toa(node->prefix), node->prefix->bitlen);
else
- fprintf(stderr, "patricia_search_best: stop at %d\n", node->bit);
+ fprintf(stderr, "patricia_search_best: stop at %u\n", node->bit);
#endif /* PATRICIA_DEBUG */
if(cnt <= 0)
"patricia_lookup: take right %s/%d\n",
prefix_toa(node->prefix), node->prefix->bitlen);
else
- fprintf(stderr, "patricia_lookup: take right at %d\n", node->bit);
+ fprintf(stderr, "patricia_lookup: take right at %u\n", node->bit);
#endif /* PATRICIA_DEBUG */
node = node->r;
}
"patricia_lookup: take left %s/%d\n",
prefix_toa(node->prefix), node->prefix->bitlen);
else
- fprintf(stderr, "patricia_lookup: take left at %d\n", node->bit);
+ fprintf(stderr, "patricia_lookup: take left at %u\n", node->bit);
#endif /* PATRICIA_DEBUG */
node = node->l;
}
if(differ_bit > check_bit)
differ_bit = check_bit;
#ifdef PATRICIA_DEBUG
- fprintf(stderr, "patricia_lookup: differ_bit %d\n", differ_bit);
+ fprintf(stderr, "patricia_lookup: differ_bit %u\n", differ_bit);
#endif /* PATRICIA_DEBUG */
parent = node->parent;
fprintf(stderr, "patricia_lookup: up to %s/%d\n",
prefix_toa(node->prefix), node->prefix->bitlen);
else
- fprintf(stderr, "patricia_lookup: up to %d\n", node->bit);
+ fprintf(stderr, "patricia_lookup: up to %u\n", node->bit);
#endif /* PATRICIA_DEBUG */
}