From 3f4cfa338b5035b3789ea414eab9f139a18d140b Mon Sep 17 00:00:00 2001 From: Craig Barnes Date: Thu, 14 Jan 2021 21:30:06 +0000 Subject: Add xsnprintf() and remove some unnecessary strlen(3) calls --- input.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'input.c') diff --git a/input.c b/input.c index 33127afd..ffbd7b34 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; @@ -974,8 +975,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 { -- cgit v1.3