X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=lib%2Fskiplist.c;h=3933429c3b0bd737dde7fda12cea324dc81c4b15;hb=c52e2ecf95a9be318912caacc0851d9307e679f7;hp=a36bf47139c307ceacc85629427a747dec394939;hpb=91a4566c1c86b7a291d7a572f64ca7e8fd8eff0c;p=mirror_frr.git diff --git a/lib/skiplist.c b/lib/skiplist.c index a36bf4713..3933429c3 100644 --- a/lib/skiplist.c +++ b/lib/skiplist.c @@ -183,8 +183,8 @@ int skiplist_insert(register struct skiplist *l, register void *key, /* DEBUG */ if (!key) { - flog_err(LIB_ERR_DEVELOPMENT, "%s: key is 0, value is %p", - __func__, value); + flog_err(EC_LIB_DEVELOPMENT, "%s: key is 0, value is %p", + __func__, value); } p = l->header; @@ -202,6 +202,7 @@ int skiplist_insert(register struct skiplist *l, register void *key, } k = randomLevel(); + assert(k >= 0); if (k > l->level) { k = ++l->level; update[k] = l->header;