wierd construction

Radovan Sroka <[email protected]>
Newsgroups gmane.comp.tools.sudo.devel
Message-ID <[email protected]>
Hi,

I'm just doing static analysis, and I found something curious in plugins/sudoers/visudo.c.

if (editor_path == NULL) {
	/* def_editor could be a path, split it up, avoiding strtok() */
	const char *def_editor_end = def_editor + strlen(def_editor);
	const char *cp, *ep;
	for (cp = sudo_strsplit(def_editor, def_editor_end, ":", &ep);
	    cp != NULL; cp = sudo_strsplit(NULL, def_editor_end, ":", &ep)) {
	    editor_path = resolve_editor(cp, (size_t)(ep - cp), 2, files,
		editor_argc, editor_argv, whitelist);
	    if (editor_path == NULL && errno != ENOENT)
		debug_return_str(NULL);
	} while (ep != NULL && editor_path == NULL);
}

Do you see for-while construction?

I doubt that was your intention. I suppose that you were changing "for" for "while" cycle and not successful.

What do you thing about that?


Radovan Sroka


____________________________________________________________
sudo-workers mailing list <[email protected]>
For list information, options, or to unsubscribe, visit:
http://www.sudo.ws/mailman/listinfo/sudo-workers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.