diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2020-09-16 18:37:56 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2020-09-16 18:37:56 +0000 |
commit | 4f63105a8cc79d5502081e3bc45c140cfe5a37f5 (patch) | |
tree | fb00b4c4ad8129b7c6496649b4917a35d26d1739 /usr.bin/tmux | |
parent | 9124c47097f34475240175f8ab1bbfc8e8da589c (diff) |
Fix some warnings, GitHub issue 2382.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/format.c | 7 | ||||
-rw-r--r-- | usr.bin/tmux/menu.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/server.c | 10 | ||||
-rw-r--r-- | usr.bin/tmux/utf8.c | 6 | ||||
-rw-r--r-- | usr.bin/tmux/window-copy.c | 23 |
5 files changed, 15 insertions, 35 deletions
diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c index 7217e10a019..1c1a2a82ac9 100644 --- a/usr.bin/tmux/format.c +++ b/usr.bin/tmux/format.c @@ -1,4 +1,4 @@ -/* $OpenBSD: format.c,v 1.261 2020/08/27 06:55:54 nicm Exp $ */ +/* $OpenBSD: format.c,v 1.262 2020/09/16 18:37:55 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -1373,7 +1373,6 @@ format_pretty_time(time_t t) struct tm now_tm, tm; time_t now, age; char s[6]; - int m; time(&now); if (now < t) @@ -1397,10 +1396,6 @@ format_pretty_time(time_t t) } /* Last 12 months. */ - if (now_tm.tm_mon == 0) - m = 11; - else - m = now_tm.tm_mon - 1; if ((tm.tm_year == now_tm.tm_year && tm.tm_mon < now_tm.tm_mon) || (tm.tm_year == now_tm.tm_year - 1 && tm.tm_mon > now_tm.tm_mon)) { strftime(s, sizeof s, "%d%b", &tm); diff --git a/usr.bin/tmux/menu.c b/usr.bin/tmux/menu.c index f2ec947d0c0..d6b7cb4e038 100644 --- a/usr.bin/tmux/menu.c +++ b/usr.bin/tmux/menu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: menu.c,v 1.30 2020/05/25 11:59:50 nicm Exp $ */ +/* $OpenBSD: menu.c,v 1.31 2020/09/16 18:37:55 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -187,7 +187,7 @@ menu_key_cb(struct client *c, struct key_event *event) struct mouse_event *m = &event->m; u_int i; int count = menu->count, old = md->choice; - const char *name; + const char *name = NULL; const struct menu_item *item; struct cmdq_state *state; enum cmd_parse_status status; diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c index f8d0a17bf29..2890d8357f2 100644 --- a/usr.bin/tmux/server.c +++ b/usr.bin/tmux/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.194 2020/06/18 08:34:22 nicm Exp $ */ +/* $OpenBSD: server.c,v 1.195 2020/09/16 18:37:55 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -158,7 +158,7 @@ server_start(struct tmuxproc *client, int flags, struct event_base *base, { int pair[2]; sigset_t set, oldset; - struct client *c; + struct client *c = NULL; char *cause = NULL; sigfillset(&set); @@ -224,9 +224,11 @@ server_start(struct tmuxproc *client, int flags, struct event_base *base, } if (cause != NULL) { - cmdq_append(c, cmdq_get_error(cause)); + if (c != NULL) { + cmdq_append(c, cmdq_get_error(cause)); + c->flags |= CLIENT_EXIT; + } free(cause); - c->flags |= CLIENT_EXIT; } server_add_accept(0); diff --git a/usr.bin/tmux/utf8.c b/usr.bin/tmux/utf8.c index a369b2b76ef..63b60540995 100644 --- a/usr.bin/tmux/utf8.c +++ b/usr.bin/tmux/utf8.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utf8.c,v 1.56 2020/07/21 05:24:33 nicm Exp $ */ +/* $OpenBSD: utf8.c,v 1.57 2020/09/16 18:37:55 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -101,9 +101,9 @@ utf8_put_item(const char *data, size_t size, u_int *index) ui = utf8_item_by_data(data, size); if (ui != NULL) { + *index = ui->index; log_debug("%s: found %.*s = %u", __func__, (int)size, data, *index); - *index = ui->index; return (0); } @@ -118,8 +118,8 @@ utf8_put_item(const char *data, size_t size, u_int *index) ui->size = size; RB_INSERT(utf8_data_tree, &utf8_data_tree, ui); - log_debug("%s: added %.*s = %u", __func__, (int)size, data, *index); *index = ui->index; + log_debug("%s: added %.*s = %u", __func__, (int)size, data, *index); return (0); } diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c index ecb964fdb6d..311b3f72067 100644 --- a/usr.bin/tmux/window-copy.c +++ b/usr.bin/tmux/window-copy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window-copy.c,v 1.302 2020/08/05 09:11:09 nicm Exp $ */ +/* $OpenBSD: window-copy.c,v 1.303 2020/09/16 18:37:55 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -72,7 +72,6 @@ static int window_copy_search_marks(struct window_mode_entry *, struct screen *, int, int); static void window_copy_clear_marks(struct window_mode_entry *); static void window_copy_move_left(struct screen *, u_int *, u_int *, int); -static void window_copy_move_right(struct screen *, u_int *, u_int *, int); static int window_copy_is_lowercase(const char *); static int window_copy_search_jump(struct window_mode_entry *, struct grid *, struct grid *, u_int, u_int, u_int, int, int, @@ -2817,23 +2816,6 @@ window_copy_move_left(struct screen *s, u_int *fx, u_int *fy, int wrapflag) *fx = *fx - 1; } -static void -window_copy_move_right(struct screen *s, u_int *fx, u_int *fy, int wrapflag) -{ - if (*fx == screen_size_x(s) - 1) { /* right */ - if (*fy == screen_hsize(s) + screen_size_y(s) - 1) { /* bottom */ - if (wrapflag) { - *fx = 0; - *fy = 0; - } - return; - } - *fx = 0; - *fy = *fy + 1; - } else - *fx = *fx + 1; -} - static int window_copy_is_lowercase(const char *ptr) { @@ -2930,7 +2912,8 @@ window_copy_search_jump(struct window_mode_entry *wme, struct grid *gd, * down. */ static int -window_copy_search(struct window_mode_entry *wme, int direction, int regex, int again) +window_copy_search(struct window_mode_entry *wme, int direction, int regex, + int again) { struct window_pane *wp = wme->wp; struct window_copy_mode_data *data = wme->data; |