diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2018-09-08 19:47:05 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2018-09-08 20:34:35 +0200 |
commit | f70247febe1e61bb77f9ba318a7dea55491d0b84 (patch) | |
tree | f8601694f0f8195c426edf3796120d1b67ce9b86 /lib/skiplist.c | |
parent | lib, ldpd: fix SA warnings from TAILQ oddness (diff) | |
download | frr-f70247febe1e61bb77f9ba318a7dea55491d0b84.tar.xz frr-f70247febe1e61bb77f9ba318a7dea55491d0b84.zip |
lib: fix SA warning in skiplist code
Clang was thinking the random level could be negative. (And, no, I
couldn't figure that out by reading its output... trial and error this
was.)
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'lib/skiplist.c')
-rw-r--r-- | lib/skiplist.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/skiplist.c b/lib/skiplist.c index a36bf4713..585cf859e 100644 --- a/lib/skiplist.c +++ b/lib/skiplist.c @@ -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; |