summaryrefslogtreecommitdiffstats
path: root/server-fn.c
diff options
context:
space:
mode:
authornicm <nicm>2015-11-24 23:46:15 +0000
committernicm <nicm>2015-11-24 23:46:15 +0000
commit62d3af17f9e6aec244ab1d91c1c46fdbbf6f8a86 (patch)
treee1479657534e995ea2d25785a08d3f0238b66338 /server-fn.c
parent3ff46b2e43d48376f74c0fd74b5616925d4063f0 (diff)
Make environ_set va_args and use it to tidy up some calls. Also add a
missing word in manpage (from jmc).
Diffstat (limited to 'server-fn.c')
-rw-r--r--server-fn.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/server-fn.c b/server-fn.c
index 3e4b6116..a22c964d 100644
--- a/server-fn.c
+++ b/server-fn.c
@@ -34,20 +34,19 @@ void server_callback_identify(int, short, void *);
void
server_fill_environ(struct session *s, struct environ *env)
{
- char var[PATH_MAX], *term;
- u_int idx;
- long pid;
+ char *term;
+ u_int idx;
+ long pid;
if (s != NULL) {
term = options_get_string(global_options, "default-terminal");
- environ_set(env, "TERM", term);
+ environ_set(env, "TERM", "%s", term);
idx = s->id;
} else
idx = (u_int)-1;
pid = getpid();
- xsnprintf(var, sizeof var, "%s,%ld,%u", socket_path, pid, idx);
- environ_set(env, "TMUX", var);
+ environ_set(env, "TMUX", "%s,%ld,%u", socket_path, pid, idx);
}
void