From: Arran Cudbard-Bell Date: Thu, 2 Mar 2017 20:24:43 +0000 (-0500) Subject: Quiet clang scan X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cdcd8b37494df41be2f0302b13439f9fb8c3963b;p=thirdparty%2Ffreeradius-server.git Quiet clang scan --- diff --git a/src/main/dl.c b/src/main/dl.c index c9a01fda7cf..5c3bb9ce4b3 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)