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

@@ -377,8 +377,8 @@ parse_plugin(const char *entry, const char *conf_file, unsigned int lineno)
oom:
sudo_warnx(U_("%s: %s"), __func__, U_("unable to allocate memory"));
if (options != NULL) {
while (nopts--)
free(options[nopts]);
while (nopts)
free(options[--nopts]);
free(options);
}
if (info != NULL) {
@@ -575,7 +575,7 @@ sudo_conf_init(int conf_types)
struct sudo_conf_debug *debug_spec;
struct sudo_debug_file *debug_file;
struct plugin_info *plugin_info;
int i;
size_t i;
debug_decl(sudo_conf_init, SUDO_DEBUG_UTIL);
/* Free and reset paths. */
@@ -717,7 +717,7 @@ sudo_conf_read_v1(const char *path, int conf_types)
while (sudo_parseln(&line, &linesize, &conf_lineno, fp, 0) != -1) {
struct sudo_conf_table *cur;
unsigned int i;
size_t i;
char *cp;
if (*(cp = line) == '\0')