From: Todd C. Miller Date: Tue, 18 Aug 2015 14:34:10 +0000 (-0600) Subject: Remove extraneous while() from botched do {} while() loop X-Git-Tag: SUDO_1_8_15^2~81 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7ef9b5827e6329e76847e13ff4c993a0d60bffbb;p=sudo Remove extraneous while() from botched do {} while() loop conversion to use sudo_strsplit. Noticed by Radovan Sroka. --- diff --git a/plugins/sudoers/sudoers.c b/plugins/sudoers/sudoers.c index 6fb7674fc..fd5c58f2d 100644 --- a/plugins/sudoers/sudoers.c +++ b/plugins/sudoers/sudoers.c @@ -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"), diff --git a/plugins/sudoers/visudo.c b/plugins/sudoers/visudo.c index 8e630b379..d36ab5727 100644 --- a/plugins/sudoers/visudo.c +++ b/plugins/sudoers/visudo.c @@ -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);