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 | a43ad4fef85196592e59665fa9b69eddb30592e0 (diff) | |
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 a36bf47139..585cf859e5 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; |
