librpc: Simplify dcerpc_binding_string()
authorVolker Lendecke <vl@samba.org>
Sun, 24 Jan 2021 14:07:47 +0000 (15:07 +0100)
committerVolker Lendecke <vl@samba.org>
Thu, 28 Jan 2021 16:58:35 +0000 (16:58 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Samuel Cabrero <scabrero@samba.org>
librpc/rpc/binding.c

index d4ca43e806662072910d9aae5283b6d0729dfa18..7e20966b121833d425dbc9bfabd62a9d68bc8a23 100644 (file)
@@ -265,19 +265,13 @@ _PUBLIC_ char *dcerpc_binding_string(TALLOC_CTX *mem_ctx, const struct dcerpc_bi
                }
        }
 
-       if (b->endpoint) {
-               option_section = true;
-       } else if (target_hostname) {
-               option_section = true;
-       } else if (b->target_principal) {
-               option_section = true;
-       } else if (b->assoc_group_id != 0) {
-               option_section = true;
-       } else if (b->options) {
-               option_section = true;
-       } else if (b->flags) {
-               option_section = true;
-       }
+       option_section =
+               (b->endpoint != NULL) ||
+               (target_hostname != NULL) ||
+               (b->target_principal != NULL) ||
+               (b->assoc_group_id != 0) ||
+               (b->options != NULL) ||
+               (b->flags != 0);
 
        if (!option_section) {
                return s;