diff --git a/cmd-new-session.c b/cmd-new-session.c index 8e5520c6..7df7dcb6 100644 --- a/cmd-new-session.c +++ b/cmd-new-session.c @@ -74,8 +74,8 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) struct environ *env; struct termios tio, *tiop; const char *newname, *target, *update, *errstr, *template; - const char *path, *cwd, *to_free = NULL; - char **argv, *cmd, *cause, *cp; + const char *path, *cmd, *cwd, *to_free = NULL; + char **argv, *cause, *cp; int detached, already_attached, idx, argc; u_int sx, sy; struct format_tree *ft; @@ -217,7 +217,7 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) cmd = options_get_string(global_s_options, "default-command"); if (cmd != NULL && *cmd != '\0') { argc = 1; - argv = &cmd; + argv = (char **)&cmd; } else { argc = 0; argv = NULL; diff --git a/names.c b/names.c index 6a368825..877b2504 100644 --- a/names.c +++ b/names.c @@ -121,7 +121,8 @@ static char * format_window_name(struct window *w) { struct format_tree *ft; - char *fmt, *name; + const char *fmt; + char *name; ft = format_create(NULL, 0); format_defaults_window(ft, w); diff --git a/server-client.c b/server-client.c index e690e6ce..88abe005 100644 --- a/server-client.c +++ b/server-client.c @@ -296,12 +296,13 @@ server_client_detach(struct client *c, enum msgtype msgtype) proc_send_s(c->peer, msgtype, s->name); } -/* Execute command to replace a client, */ +/* Execute command to replace a client. */ void server_client_exec(struct client *c, const char *cmd) { struct session *s = c->session; - char *msg, *shell; + char *msg; + const char *shell; size_t cmdsize, shellsize; if (*cmd == '\0') diff --git a/server-fn.c b/server-fn.c index 8fad6791..d43461f3 100644 --- a/server-fn.c +++ b/server-fn.c @@ -35,9 +35,9 @@ static void server_destroy_session_group(struct session *); void server_fill_environ(struct session *s, struct environ *env) { - char *term; - u_int idx; - long pid; + const char *term; + u_int idx; + long pid; if (s != NULL) { term = options_get_string(global_options, "default-terminal"); diff --git a/status.c b/status.c index c54d8f40..9fc9a502 100644 --- a/status.c +++ b/status.c @@ -278,18 +278,19 @@ status_get_window_at(struct client *c, u_int x) int status_redraw(struct client *c) { - struct screen_write_ctx ctx; - struct session *s = c->session; - struct winlink *wl; - struct screen old_status, window_list; - struct grid_cell stdgc, lgc, rgc, gc; - struct options *oo; - time_t t; - char *left, *right, *sep; - u_int offset, needed; - u_int wlstart, wlwidth, wlavailable, wloffset, wlsize; - size_t llen, rlen, seplen; - int larrow, rarrow; + struct screen_write_ctx ctx; + struct session *s = c->session; + struct winlink *wl; + struct screen old_status, window_list; + struct grid_cell stdgc, lgc, rgc, gc; + struct options *oo; + time_t t; + char *left, *right; + const char *sep; + u_int offset, needed; + u_int wlstart, wlwidth, wlavailable, wloffset, wlsize; + size_t llen, rlen, seplen; + int larrow, rarrow; /* No status line? */ if (c->tty.sy == 0 || !options_get_number(s->options, "status")) diff --git a/tty-term.c b/tty-term.c index 654b926d..0496f1f3 100644 --- a/tty-term.c +++ b/tty-term.c @@ -385,8 +385,7 @@ tty_term_find(char *name, int fd, char **cause) struct tty_code *code; u_int i; int n, error; - char *s; - const char *acs; + const char *s, *acs; LIST_FOREACH(term, &tty_terms, entry) { if (strcmp(term->name, name) == 0) {