From 68d797587ef2acf1464a9390912e4a22e4db6482 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 15 Jan 2016 11:31:47 +0000 Subject: [PATCH 1/2] A couple of missing printflike attributes, from Andrey Starodubtsev. --- input.c | 2 +- tmux.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/input.c b/input.c index ed1ebffc..19fd48b7 100644 --- a/input.c +++ b/input.c @@ -100,7 +100,7 @@ struct input_ctx { struct input_transition; int input_split(struct input_ctx *); int input_get(struct input_ctx *, u_int, int, int); -void input_reply(struct input_ctx *, const char *, ...); +void printflike(2, 3) input_reply(struct input_ctx *, const char *, ...); void input_set_state(struct window_pane *, const struct input_transition *); void input_reset_cell(struct input_ctx *); diff --git a/tmux.h b/tmux.h index 194d01d8..dbea85bf 100644 --- a/tmux.h +++ b/tmux.h @@ -1540,7 +1540,7 @@ extern struct client *cfg_client; void start_cfg(void); int load_cfg(const char *, struct cmd_q *, char **); void set_cfg_file(const char *); -void cfg_add_cause(const char *, ...); +void printflike(1, 2) cfg_add_cause(const char *, ...); void cfg_print_causes(struct cmd_q *); void cfg_show_causes(struct session *); From d551ab8e5cfb00fbb7a79e7f0c3f4f2780fc6824 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 15 Jan 2016 11:33:41 +0000 Subject: [PATCH 2/2] Clear the environment properly by looping until it is empty rather than looping over it (which may skip entries), from Brad King. --- environ.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/environ.c b/environ.c index de560896..101dfafd 100644 --- a/environ.c +++ b/environ.c @@ -196,10 +196,10 @@ void environ_push(struct environ *env) { struct environ_entry *envent; - char **vp, *v; + char *v; - for (vp = environ; *vp != NULL; vp++) { - v = xstrdup(*vp); + while (*environ != NULL) { + v = xstrdup(*environ); v[strcspn(v, "=")] = '\0'; unsetenv(v);