[PATCH] Fix some warnings

9 views
Skip to first unread message

Thomas Adam

unread,
May 14, 2019, 3:13:47 PM5/14/19
to tmux-...@googlegroups.com, Thomas Adam
---
cmd-new-session.c | 2 +-
options.c | 2 +-
server-client.c | 2 --
3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/cmd-new-session.c b/cmd-new-session.c
index 6818ce9c..c3d337ac 100644
--- a/cmd-new-session.c
+++ b/cmd-new-session.c
@@ -76,7 +76,7 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item)
const char *errstr, *template, *group, *prefix, *tmp;
char *cause, *cwd = NULL, *cp, *newname = NULL;
int detached, already_attached, is_control = 0;
- u_int sx, sy, dsx, dsy;
+ u_int sx, sy, dsx = 0, dsy = 0;
struct spawn_context sc;
enum cmd_retval retval;
struct cmd_find_state fs;
diff --git a/options.c b/options.c
index c5a776e5..c7ea62c5 100644
--- a/options.c
+++ b/options.c
@@ -353,7 +353,7 @@ options_array_set(struct options_entry *o, u_int idx, const char *value,
{
struct options_array_item *a;
char *new;
- struct cmd_list *cmdlist;
+ struct cmd_list *cmdlist = NULL;

if (!OPTIONS_IS_ARRAY(o)) {
*cause = xstrdup("not an array");
diff --git a/server-client.c b/server-client.c
index fdc40d8d..4d0d3f57 100644
--- a/server-client.c
+++ b/server-client.c
@@ -1001,7 +1001,6 @@ server_client_key_callback(struct cmdq_item *item, void *data)
struct mouse_event *m = &event->m;
struct session *s = c->session;
struct winlink *wl;
- struct window *w;
struct window_pane *wp;
struct window_mode_entry *wme;
struct timeval tv;
@@ -1015,7 +1014,6 @@ server_client_key_callback(struct cmdq_item *item, void *data)
if (s == NULL || (c->flags & (CLIENT_DEAD|CLIENT_SUSPENDED)) != 0)
goto out;
wl = s->curw;
- w = wl->window;

/* Update the activity timer. */
if (gettimeofday(&c->activity_time, NULL) != 0)
--
2.20.1

Nicholas Marriott

unread,
May 15, 2019, 2:46:31 AM5/15/19
to Thomas Adam, tmux-...@googlegroups.com
Does this fix the warning instead?

Index: cmd-new-session.c
===================================================================
RCS file: /cvs/src/usr.bin/tmux/cmd-new-session.c,v
retrieving revision 1.117
diff -u -p -r1.117 cmd-new-session.c
--- cmd-new-session.c 26 Apr 2019 11:38:51 -0000 1.117
+++ cmd-new-session.c 15 May 2019 06:45:52 -0000
@@ -192,6 +192,8 @@ cmd_new_session_exec(struct cmd *self, s
if (strcmp(tmp, "-") == 0) {
if (c != NULL)
dsx = c->tty.sx;
+ else
+ dsx = 80;
} else {
dsx = strtonum(tmp, 1, USHRT_MAX, &errstr);
if (errstr != NULL) {
@@ -205,6 +207,8 @@ cmd_new_session_exec(struct cmd *self, s
if (strcmp(tmp, "-") == 0) {
if (c != NULL)
dsy = c->tty.sy;
+ else
+ dsy = 24;
} else {
dsy = strtonum(tmp, 1, USHRT_MAX, &errstr);
if (errstr != NULL) {
> --
> You received this message because you are subscribed to the Google Groups "tmux-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com.
> To post to this group, send an email to tmux-...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/tmux-users/20190510212205.14486-1-thomas%40xteddy.org.
> For more options, visit https://groups.google.com/d/optout.

Thomas Adam

unread,
May 16, 2019, 5:20:14 PM5/16/19
to Nicholas Marriott, Thomas Adam, tmux-...@googlegroups.com
On Wed, May 15, 2019 at 07:46:07AM +0100, Nicholas Marriott wrote:
> Does this fix the warning instead?

Yes, this also works.

Kindly,
Thomas
Reply all
Reply to author
Forward
0 new messages