calloc for confirm-before data since the item needs to start NULL.
authornicm <nicm@openbsd.org>
Tue, 17 Aug 2021 11:20:13 +0000 (11:20 +0000)
committernicm <nicm@openbsd.org>
Tue, 17 Aug 2021 11:20:13 +0000 (11:20 +0000)
usr.bin/tmux/cmd-confirm-before.c
usr.bin/tmux/tty.c

index 059f4bf..ce051ed 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-confirm-before.c,v 1.45 2021/08/13 06:50:42 nicm Exp $ */
+/* $OpenBSD: cmd-confirm-before.c,v 1.46 2021/08/17 11:20:13 nicm Exp $ */
 
 /*
  * Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -72,7 +72,7 @@ cmd_confirm_before_exec(struct cmd *self, struct cmdq_item *item)
                free(copy);
        }
 
-       cdata = xmalloc(sizeof *cdata);
+       cdata = xcalloc(1, sizeof *cdata);
        cdata->cmd = xstrdup(args->argv[0]);
 
        cmd_get_source(self, &cdata->pi.file, &cdata->pi.line);
index 1224871..8be5aad 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty.c,v 1.402 2021/08/17 08:44:52 nicm Exp $ */
+/* $OpenBSD: tty.c,v 1.403 2021/08/17 11:20:13 nicm Exp $ */
 
 /*
  * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -2043,7 +2043,7 @@ tty_cmd_syncstart(struct tty *tty, const struct tty_ctx *ctx)
 {
        if (ctx->num == 0x11) {
                /*
-                * This is an overlay and a command that moves, the cursor so
+                * This is an overlay and a command that moves the cursor so
                 * start synchronized updates.
                 */
                tty_sync_start(tty);