policycoreutils/semodule: fix -Wwrite-strings warnings

Nicolass Iooss reports that when building with "clang -Wwrite-strings",
the compiler complains about initializing the char* array
genhomedirconargv with literal strings.

Make genhomedirconargv an array of pointers to const char and cast it
as non-const when assigning it to argv.

Signed-off-by: James Carter <jwcart2@tycho.nsa.gov>
This commit is contained in:
James Carter 2017-02-06 11:06:42 -05:00
parent 68a4203f87
commit 1f312a9247

View file

@ -341,11 +341,11 @@ int main(int argc, char *argv[])
int i, commit = 0;
int result;
int status = EXIT_FAILURE;
char *genhomedirconargv[] = { "genhomedircon", "-B", "-n" };
const char *genhomedirconargv[] = { "genhomedircon", "-B", "-n" };
create_signal_handlers();
if (strcmp(basename(argv[0]), "genhomedircon") == 0) {
argc = 3;
argv=genhomedirconargv;
argv = (char **)genhomedirconargv;
}
parse_command_line(argc, argv);