From cdcd8b37494df41be2f0302b13439f9fb8c3963b Mon Sep 17 00:00:00 2001 From: Arran Cudbard-Bell Date: Thu, 2 Mar 2017 15:24:43 -0500 Subject: [PATCH] Quiet clang scan --- src/main/dl.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/dl.c b/src/main/dl.c index c9a01fda7cf7..5c3bb9ce4b3c 100644 --- a/src/main/dl.c +++ b/src/main/dl.c @@ -101,11 +101,13 @@ static int dl_module_sym_init_cmp(void const *one, void const *two) dl_module_sym_init_t const *a = one; dl_module_sym_init_t const *b = two; + rad_assert(a && b); + if (a->symbol && !b->symbol) return +1; if (!b->symbol && a->symbol) return -1; - if (!a->symbol && !b->symbol) return 0; + if (a->symbol && b->symbol) return strcmp(a->symbol, b->symbol); - return strcmp(a->symbol, b->symbol); + return 0; } static int dl_module_sym_free_cmp(void const *one, void const *two) @@ -113,11 +115,13 @@ static int dl_module_sym_free_cmp(void const *one, void const *two) dl_module_sym_free_t const *a = one; dl_module_sym_free_t const *b = two; + rad_assert(a && b); + if (a->symbol && !b->symbol) return +1; if (!b->symbol && a->symbol) return -1; - if (!a->symbol && !b->symbol) return 0; + if (a->symbol && b->symbol) strcmp(a->symbol, b->symbol); - return strcmp(a->symbol, b->symbol); + return 0; } static int dl_module_sym_cmp(void const *one, void const *two)