fix write-strings warning

This commit is contained in:
Daniel Micay 2012-06-08 16:01:36 -04:00
parent dd83a2e6a2
commit ca96b678f3
2 changed files with 5 additions and 3 deletions

View File

@ -15,6 +15,7 @@ CFLAGS := -std=c99 -O3 \
-Wc++-compat \ -Wc++-compat \
-Wbad-function-cast \ -Wbad-function-cast \
-Wunused-macros \ -Wunused-macros \
-Wwrite-strings \
${shell pkg-config --cflags ${GTK} ${VTE}} \ ${shell pkg-config --cflags ${GTK} ${VTE}} \
${CFLAGS} ${CFLAGS}

View File

@ -437,13 +437,14 @@ int main(int argc, char **argv) {
GtkWidget *vte = vte_terminal_new(); GtkWidget *vte = vte_terminal_new();
char **command_argv; char **command_argv;
char *default_argv[2] = {NULL, NULL}; char fallback[] = "/bin/sh";
char *default_argv[2] = {fallback, NULL};
if (argc > 1) { if (argc > 1) {
command_argv = &argv[1]; command_argv = &argv[1];
} else { } else {
default_argv[0] = vte_get_user_shell(); char *shell = vte_get_user_shell();
if (!default_argv[0]) default_argv[0] = "/bin/sh"; if (shell) default_argv[0] = shell;
command_argv = default_argv; command_argv = default_argv;
} }