diff options
author | Thomas Adam <thomas@xteddy.org> | 2023-06-30 16:01:10 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2023-06-30 16:01:10 +0100 |
commit | 237ee6f2311b351b8a3bb3b46e17622f6e3b6bb9 (patch) | |
tree | b9c4298a78b4a85dfcb517a6648570a331ae5d17 | |
parent | 8c9fbbf4f3baae95c0ec437108f39483ced815cb (diff) | |
parent | 4e57894e8506f27844fc0e6353475a0b61fd7807 (diff) |
Merge branch 'obsd-master'
-rw-r--r-- | cmd-resize-window.c | 3 | ||||
-rw-r--r-- | format.c | 2 | ||||
-rw-r--r-- | hyperlinks.c | 2 | ||||
-rw-r--r-- | input.c | 4 | ||||
-rw-r--r-- | notify.c | 4 | ||||
-rw-r--r-- | tty-keys.c | 2 | ||||
-rw-r--r-- | tty-term.c | 4 |
7 files changed, 12 insertions, 9 deletions
diff --git a/cmd-resize-window.c b/cmd-resize-window.c index ad739165..c420451c 100644 --- a/cmd-resize-window.c +++ b/cmd-resize-window.c @@ -53,8 +53,7 @@ cmd_resize_window_exec(struct cmd *self, struct cmdq_item *item) struct session *s = target->s; const char *errstr; char *cause; - u_int adjust, sx, sy; - int xpixel = -1, ypixel = -1; + u_int adjust, sx, sy, xpixel = 0, ypixel = 0; if (args_count(args) == 0) adjust = 1; @@ -3813,7 +3813,7 @@ format_build_modifiers(struct format_expand_state *es, const char **s, argc = 0; /* Single argument with no wrapper character. */ - if (!ispunct(cp[1]) || cp[1] == '-') { + if (!ispunct((u_char)cp[1]) || cp[1] == '-') { end = format_skip(cp + 1, ":;"); if (end == NULL) break; diff --git a/hyperlinks.c b/hyperlinks.c index cde500c0..70c2f4e3 100644 --- a/hyperlinks.c +++ b/hyperlinks.c @@ -42,7 +42,7 @@ #define MAX_HYPERLINKS 5000 -static uint64_t hyperlinks_next_external_id = 1; +static long long hyperlinks_next_external_id = 1; static u_int global_hyperlinks_count; struct hyperlinks_uri { @@ -2842,9 +2842,11 @@ input_reply_clipboard(struct bufferevent *bev, const char *buf, size_t len, const char *end) { char *out = NULL; - size_t outlen = 0; + int outlen = 0; if (buf != NULL && len != 0) { + if (len >= ((size_t)INT_MAX * 3 / 4) - 1) + return; outlen = 4 * ((len + 2) / 3) + 1; out = xmalloc(outlen); if ((outlen = b64_ntop(buf, len, out, outlen)) == -1) { @@ -193,7 +193,7 @@ notify_add(const char *name, struct cmd_find_state *fs, struct client *c, ne->client = c; ne->session = s; ne->window = w; - ne->pane = (wp != NULL ? wp->id : -1); + ne->pane = (wp != NULL ? (int)wp->id : -1); ne->pbname = (pbname != NULL ? xstrdup(pbname) : NULL); ne->formats = format_create(NULL, NULL, 0, FORMAT_NOJOBS); @@ -240,7 +240,7 @@ notify_hook(struct cmdq_item *item, const char *name) ne.client = cmdq_get_client(item); ne.session = target->s; ne.window = target->w; - ne.pane = (target->wp != NULL ? target->wp->id : -1); + ne.pane = (target->wp != NULL ? (int)target->wp->id : -1); ne.formats = format_create(NULL, NULL, 0, FORMAT_NOJOBS); format_add(ne.formats, "hook", "%s", name); @@ -1160,7 +1160,7 @@ tty_keys_clipboard(struct tty *tty, const char *buf, size_t len, size_t *size) { struct client *c = tty->client; struct window_pane *wp; - size_t end, terminator, needed; + size_t end, terminator = 0, needed; char *copy, *out; int outlen; u_int i; @@ -718,7 +718,7 @@ tty_term_read_list(const char *name, int fd, char ***caps, u_int *ncaps, s = tmp; break; case TTYCODE_FLAG: - n = tigetflag((char *) ent->name); + n = tigetflag((char *)ent->name); if (n == -1) continue; if (n) @@ -726,6 +726,8 @@ tty_term_read_list(const char *name, int fd, char ***caps, u_int *ncaps, else s = "0"; break; + default: + fatalx("unknown capability type"); } *caps = xreallocarray(*caps, (*ncaps) + 1, sizeof **caps); xasprintf(&(*caps)[*ncaps], "%s=%s", ent->name, s); |