#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h> // ffs() lives here
#include "xmalloc.h"
#include "uid_db.h"
This routine is intended for inserts only.
*/
struct pat_node *cur, **edge;
- unsigned bit_ndx, v, ofs;
+ unsigned bit_ndx, v = 0, ofs;
cur = db->pat_root;
ofs = -1;
}
/*** various helpers */
+#if 0
static inline int record_id_equal(struct uid_db_record const *r0,
struct uid_db_record const *r1)
{
r0->id_len == r1->id_len
&& memcmp(r0->id, r1->id, r0->id_len) == 0;
}
+#endif
static struct uid_db_record *append_to_list(struct uid_db_record **recp,
struct uid_db_record *rec)
*/
struct pat_node *np;
struct uid_db_record *rec;
- unsigned v, bit_ndx, ofs;
+ unsigned v = 0, bit_ndx, ofs;
size_t len;
np = db->pat_root;
/** destruction */
static void free_uid_list(struct uid_db_record *rec)
{
+ if (!rec) return;
+
/*
Free the list of uid_db_records starting with
the record pointed to by rec.