Make sudo pass -Wwrite-strings
This commit is contained in:
@@ -29,12 +29,12 @@
|
||||
|
||||
/* Note hard-coded array lengths. */
|
||||
struct test_data {
|
||||
char *editor_var;
|
||||
const char *editor_var;
|
||||
int nfiles;
|
||||
char *files[4];
|
||||
char *editor_path;
|
||||
const char *files[4];
|
||||
const char *editor_path;
|
||||
int edit_argc;
|
||||
char *edit_argv[10];
|
||||
const char *edit_argv[10];
|
||||
} test_data[] = {
|
||||
{
|
||||
/* Bug #942 */
|
||||
@@ -99,13 +99,13 @@ main(int argc, char *argv[])
|
||||
int i, edit_argc = 0;
|
||||
|
||||
/* clear existing editor environment vars */
|
||||
putenv("VISUAL=");
|
||||
putenv("EDITOR=");
|
||||
putenv("SUDO_EDITOR=");
|
||||
putenv((char *)"VISUAL=");
|
||||
putenv((char *)"EDITOR=");
|
||||
putenv((char *)"SUDO_EDITOR=");
|
||||
|
||||
putenv(data->editor_var);
|
||||
editor_path = find_editor(data->nfiles, data->files, &edit_argc,
|
||||
&edit_argv, NULL, &env_editor);
|
||||
putenv((char *)data->editor_var);
|
||||
editor_path = find_editor(data->nfiles, (char **)data->files,
|
||||
&edit_argc, &edit_argv, NULL, &env_editor);
|
||||
ntests++;
|
||||
if (strcmp(editor_path, data->editor_path) != 0) {
|
||||
sudo_warnx("test %d: editor_path: expected \"%s\", got \"%s\"",
|
||||
|
Reference in New Issue
Block a user