From: James Jones Date: Wed, 1 Jun 2022 01:25:31 +0000 (-0500) Subject: Cast to void where we know a call will work or just want side effects (#4537) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3dc56fe1b886e4249ce1011303033d220e3df400;p=thirdparty%2Ffreeradius-server.git Cast to void where we know a call will work or just want side effects (#4537) This deals with the following CIDs: 1469133, 1503911, 1503964, 1504282 (#1 of 5) --- diff --git a/src/lib/server/snmp.c b/src/lib/server/snmp.c index ef29ca265c4..6f049931fa1 100644 --- a/src/lib/server/snmp.c +++ b/src/lib/server/snmp.c @@ -1028,7 +1028,7 @@ int fr_snmp_process(request_t *request) fr_sbuff_t oid_str_sbuff = FR_SBUFF_OUT(oid_str, sizeof(oid_str)); fr_pair_list_free(&head); - fr_sbuff_in_char(&oid_str_sbuff, '.'); + (void) fr_sbuff_in_char(&oid_str_sbuff, '.'); /* Get the length of the matching part */ oid_len = fr_dict_attr_oid_print(&oid_str_sbuff, attr_snmp_root, da_stack.da[-(ret)], false); diff --git a/src/lib/util/dict_util.c b/src/lib/util/dict_util.c index 75f5f21f7cd..8101ba2a283 100644 --- a/src/lib/util/dict_util.c +++ b/src/lib/util/dict_util.c @@ -1880,7 +1880,7 @@ ssize_t fr_dict_attr_by_oid_substr(fr_dict_attr_err_t *err, #if 0 if (!fr_sbuff_next_if_char(in, '.')) our_parent = fr_dict_root(fr_dict_by_da(parent)); #else - fr_sbuff_next_if_char(in, '.'); + (void) fr_sbuff_next_if_char(in, '.'); #endif *out = NULL; diff --git a/src/lib/util/log.c b/src/lib/util/log.c index 230b04406d6..c5ebd30428f 100644 --- a/src/lib/util/log.c +++ b/src/lib/util/log.c @@ -656,7 +656,7 @@ void fr_vlog_perror(fr_log_t const *log, fr_log_type_t type, char const *file, i /* * Add the prefix for the first line */ - if (f_rules->first_prefix) fr_sbuff_in_strcpy(&sbuff, f_rules->first_prefix); + if (f_rules->first_prefix) (void) fr_sbuff_in_strcpy(&sbuff, f_rules->first_prefix); /* * Add the (optional) message, and/or (optional) error diff --git a/src/modules/rlm_smtp/rlm_smtp.c b/src/modules/rlm_smtp/rlm_smtp.c index 6c3f62bee67..fc04edcfca6 100644 --- a/src/modules/rlm_smtp/rlm_smtp.c +++ b/src/modules/rlm_smtp/rlm_smtp.c @@ -717,7 +717,7 @@ static int attachments_source(rlm_smtp_thread_t *t, fr_mail_ctx_t *uctx, curl_mi /* Make sure the template_directory path ends in a "/" */ if (inst->template_dir[talloc_array_length(inst->template_dir)-2] != '/'){ RDEBUG2("Adding / to end of template_dir"); - fr_sbuff_in_char(&path_buffer, '/'); + (void) fr_sbuff_in_char(&path_buffer, '/'); } /* Mark the buffer so we only re-write after the template_dir component */