From dd46fedf4f7d117630ef1df830f9ec94a909cd04 Mon Sep 17 00:00:00 2001 From: Florian Stinglmayr Date: Sat, 20 Jul 2019 13:38:59 +0200 Subject: [PATCH] fix posting of messages, full parameter was broken for commands --- ncdc/src/cmds.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ncdc/src/cmds.c b/ncdc/src/cmds.c index 515c110..66cc69b 100644 --- a/ncdc/src/cmds.c +++ b/ncdc/src/cmds.c @@ -136,9 +136,11 @@ bool ncdc_dispatch(ncdc_mainwindow_t n, wchar_t const *s) */ len = wcslen(s); cmdlen = wcslen(it->name); + f = wcsdup(s); return_if_true(f == NULL, false); - memmove(f, f+cmdlen, len-cmdlen); + memmove(f, f+cmdlen, (len-cmdlen) * sizeof(wchar_t)); + f[len-cmdlen] = '\0'; item = calloc(1, sizeof(queue_item));