mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
Add xsnprintf() and remove some unnecessary strlen(3) calls
This commit is contained in:
parent
b25b8a78a9
commit
3f4cfa338b
8 changed files with 86 additions and 36 deletions
5
input.c
5
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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue