aboutsummaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorCraig Barnes <craigbarnes@protonmail.com>2021-01-14 21:30:06 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-01-21 10:57:46 +0000
commitd2c00d73ec087e2266d8e07daacb0732fc1ca761 (patch)
tree4bdbf8d3c357ac6880de00a06f83402bac48518b /input.c
parentsixel: current geometry: don’t exceed current window dimensions (diff)
Add xsnprintf() and remove some unnecessary strlen(3) calls
Diffstat (limited to 'input.c')
-rw-r--r--input.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/input.c b/input.c
index e4a1f306..205d7559 100644
--- a/input.c
+++ b/input.c
@@ -37,6 +37,7 @@
#include "util.h"
#include "vt.h"
#include "xmalloc.h"
+#include "xsnprintf.h"
struct pipe_context {
char *text;
@@ -963,8 +964,8 @@ key_press_release(struct seat *seat, struct terminal *term, uint32_t serial,
assert(modify_param != 0);
char reply[1024];
- snprintf(reply, sizeof(reply), "\x1b[27;%d;%d~", modify_param, sym);
- term_to_slave(term, reply, strlen(reply));
+ size_t n = xsnprintf(reply, sizeof(reply), "\x1b[27;%d;%d~", modify_param, sym);
+ term_to_slave(term, reply, n);
}
else {