]> granicus.if.org Git - sudo/commitdiff
Remove extraneous while() from botched do {} while() loop
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 18 Aug 2015 14:34:10 +0000 (08:34 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 18 Aug 2015 14:34:10 +0000 (08:34 -0600)
conversion to use sudo_strsplit.  Noticed by Radovan Sroka.

plugins/sudoers/sudoers.c
plugins/sudoers/visudo.c

index 6fb7674fcd6b9bde3a35461187cab08305d1dc2b..fd5c58f2deb716da9ccab77e776963dff95d6a55 100644 (file)
@@ -1214,7 +1214,7 @@ find_editor(int nfiles, char **files, int *argc_out, char ***argv_out)
                files, argc_out, argv_out, NULL);
            if (editor_path == NULL && errno != ENOENT)
                debug_return_str(NULL);
-       } while (ep != NULL && editor_path == NULL);
+       }
     }
     if (!editor_path) {
        audit_failure(NewArgc, NewArgv, N_("%s: command not found"),
index 8e630b37921d3f921c366e1f5fba3701ab054e12..d36ab5727760439ba9e50d98f89bee3d47ff257b 100644 (file)
@@ -332,7 +332,7 @@ get_editor(int *editor_argc, char ***editor_argv)
                editor_argc, editor_argv, whitelist);
            if (editor_path == NULL && errno != ENOENT)
                debug_return_str(NULL);
-       } while (ep != NULL && editor_path == NULL);
+       }
     }
     if (editor_path == NULL)
        sudo_fatalx(U_("no editor found (editor path = %s)"), def_editor);