Avoid compiler casting warnings by assigning to the same type where possible

This saves instructions that are related to casting as well as compiler warnings.
This commit is contained in:
Rose
2023-05-18 14:38:18 -04:00
parent a0b074cc9c
commit e54ba33ea0
50 changed files with 175 additions and 168 deletions

View File

@@ -112,7 +112,7 @@ usage(bool fatal)
exit(EXIT_FAILURE);
}
static void
sudo_noreturn static void
help(void)
{
printf("%s - %s\n\n", getprogname(),
@@ -400,8 +400,8 @@ free_info_messages(InfoMessage **info_msgs, size_t n_info_msgs)
debug_decl(free_info_messages, SUDO_DEBUG_UTIL);
if (info_msgs != NULL) {
while (n_info_msgs-- > 0) {
if (info_msgs[n_info_msgs]->value_case == INFO_MESSAGE__VALUE_STRLISTVAL) {
while (n_info_msgs) {
if (info_msgs[--n_info_msgs]->value_case == INFO_MESSAGE__VALUE_STRLISTVAL) {
/* Only strlistval was dynamically allocated */
free(info_msgs[n_info_msgs]->u.strlistval->strings);
free(info_msgs[n_info_msgs]->u.strlistval);