From 6e0e39b79f1a024fb8dd98101c5fc63a8ec0d8ed Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 22 Nov 2019 18:21:33 +0100 Subject: input: change mp_cmd.original from bstr to cstr No reason to have this as bstr, just makes everything more complex. Also clear mp_cmd.sender when it's copied. Otherwise it would be a dangling pointer. Apparently it's never set to non-NULL in this situation, but this is cleaner anyway. --- input/input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'input/input.c') diff --git a/input/input.c b/input/input.c index 89c2571d2b..a9ee42338e 100644 --- a/input/input.c +++ b/input/input.c @@ -282,8 +282,8 @@ static void append_bind_info(struct input_ctx *ictx, char **pmsg, char *msg = *pmsg; struct mp_cmd *cmd = mp_input_parse_cmd(ictx, bstr0(bind->cmd), bind->location); - bstr stripped = cmd ? cmd->original : bstr0(bind->cmd); - msg = talloc_asprintf_append(msg, " '%.*s'", BSTR_P(stripped)); + char *stripped = cmd ? cmd->original : bind->cmd; + msg = talloc_asprintf_append(msg, " '%s'", stripped); if (!cmd) msg = talloc_asprintf_append(msg, " (invalid)"); if (strcmp(bind->owner->section, "default") != 0) -- cgit v1.2.3