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

@@ -185,8 +185,9 @@ resolve_editor(const char *ed, size_t edlen, int nfiles, char * const *files,
}
if (nfiles != 0) {
nargv[nargc++] = (char *)"--";
while (nfiles--)
do
nargv[nargc++] = *files++;
while (--nfiles > 0);
}
nargv[nargc] = NULL;
@@ -200,8 +201,8 @@ bad:
free(editor);
free(editor_path);
if (nargv != NULL) {
while (nargc--) {
sudoers_gc_remove(GC_PTR, nargv[nargc]);
while (nargc > 0) {
sudoers_gc_remove(GC_PTR, nargv[--nargc]);
free(nargv[nargc]);
}
sudoers_gc_remove(GC_PTR, nargv);