aboutsummaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-08-09 08:54:39 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-08-09 08:54:39 +0000
commit828a57c2011eb797a9a257d124d48c641b3cac89 (patch)
treecb2539f90c8a1be1ae330c807997dfc2a98e9481 /input.c
parentchangelog: add birger to 'contributers' for the upcoming release (diff)
parentHandle allocation failures explicitly in *_init() functions (diff)
Merge branch 'xmalloc-conversion' into master
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 feaa6072..55090ff7 100644
--- a/input.c
+++ b/input.c
@@ -36,6 +36,7 @@
#include "tokenize.h"
#include "util.h"
#include "vt.h"
+#include "xmalloc.h"
struct pipe_context {
char *text;
@@ -227,7 +228,7 @@ execute_binding(struct seat *seat, struct terminal *term,
/* Close read end */
close(pipe_fd[0]);
- ctx = malloc(sizeof(*ctx));
+ ctx = xmalloc(sizeof(*ctx));
*ctx = (struct pipe_context){
.text = text,
.left = len,
@@ -268,7 +269,7 @@ input_parse_key_binding(struct xkb_keymap *keymap, const char *combos,
xkb_keysym_t sym = XKB_KEY_NoSymbol;
- char *copy = strdup(combos);
+ char *copy = xstrdup(combos);
for (char *save1 = NULL, *combo = strtok_r(copy, " ", &save1);
combo != NULL;