]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
no need for intermediate variable. CID #1504026
authorAlan T. DeKok <aland@freeradius.org>
Wed, 13 Apr 2022 12:33:22 +0000 (08:33 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 13 Apr 2022 12:55:24 +0000 (08:55 -0400)
src/lib/tls/engine.c

index c0d0d2333adf600aeb7b5f9dc5c1e95d0d331ab8..4ed82324e93b4f235ae6d796aca7ff2a5e9c9c1b 100644 (file)
@@ -72,10 +72,9 @@ static int8_t tls_engine_cmp(void const *one, void const *two)
 {
        tls_engine_t const *a = talloc_get_type_abort_const(one, tls_engine_t);
        tls_engine_t const *b = talloc_get_type_abort_const(two, tls_engine_t);
-       int8_t ret;
+       uint8_t ret;
 
-       ret = strcmp(a->id, b->id);
-       ret = CMP(ret, 0);
+       ret = CMP(strcmp(a->id, b->id), 0);
        if (ret != 0) return ret;
 
        /*
@@ -85,8 +84,7 @@ static int8_t tls_engine_cmp(void const *one, void const *two)
        if (!a->instance) return -1;
        if (!b->instance) return +1;
 
-       ret = strcmp(a->instance, b->instance);
-       return CMP(ret, 0);
+       return CMP(strcmp(a->instance, b->instance), 0);
 }
 
 /** Add the list of supported engine commands to the error stack