fix write-strings warning
This commit is contained in:
parent
dd83a2e6a2
commit
ca96b678f3
1
Makefile
1
Makefile
|
@ -15,6 +15,7 @@ CFLAGS := -std=c99 -O3 \
|
|||
-Wc++-compat \
|
||||
-Wbad-function-cast \
|
||||
-Wunused-macros \
|
||||
-Wwrite-strings \
|
||||
${shell pkg-config --cflags ${GTK} ${VTE}} \
|
||||
${CFLAGS}
|
||||
|
||||
|
|
|
@ -437,13 +437,14 @@ int main(int argc, char **argv) {
|
|||
GtkWidget *vte = vte_terminal_new();
|
||||
|
||||
char **command_argv;
|
||||
char *default_argv[2] = {NULL, NULL};
|
||||
char fallback[] = "/bin/sh";
|
||||
char *default_argv[2] = {fallback, NULL};
|
||||
|
||||
if (argc > 1) {
|
||||
command_argv = &argv[1];
|
||||
} else {
|
||||
default_argv[0] = vte_get_user_shell();
|
||||
if (!default_argv[0]) default_argv[0] = "/bin/sh";
|
||||
char *shell = vte_get_user_shell();
|
||||
if (shell) default_argv[0] = shell;
|
||||
command_argv = default_argv;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue