summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmd-resize-window.c3
-rw-r--r--format.c2
-rw-r--r--hyperlinks.c2
-rw-r--r--input.c4
-rw-r--r--notify.c4
-rw-r--r--tty-keys.c2
-rw-r--r--tty-term.c4
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;
diff --git a/format.c b/format.c
index 8cbf0a64..e383a141 100644
--- a/format.c
+++ b/format.c
@@ -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 18163cb2..913ed2fa 100644
--- a/hyperlinks.c
+++ b/hyperlinks.c
@@ -43,7 +43,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 {
diff --git a/input.c b/input.c
index b2d28386..dd22ac75 100644
--- a/input.c
+++ b/input.c
@@ -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) {
diff --git a/notify.c b/notify.c
index 138fbeb1..aadfd450 100644
--- a/notify.c
+++ b/notify.c
@@ -194,7 +194,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);
@@ -241,7 +241,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);
diff --git a/tty-keys.c b/tty-keys.c
index 25956c4d..e3000e5a 100644
--- a/tty-keys.c
+++ b/tty-keys.c
@@ -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;
diff --git a/tty-term.c b/tty-term.c
index 9b897c67..a2798347 100644
--- a/tty-term.c
+++ b/tty-term.c
@@ -709,7 +709,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)
@@ -717,6 +717,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);