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) {


On Fri, May 10, 2019 at 10:22:05PM +0100, Thomas Adam wrote:
> ---
>  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
> 
> -- 
> 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 [email protected].
> To post to this group, send an email to [email protected].
> 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.

-- 
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 [email protected].
To post to this group, send an email to [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/tmux-users/20190515064607.qqv4655unsvluw3w%40yelena.
For more options, visit https://groups.google.com/d/optout.

Reply via email to