From 1ea247e116478641609e072f5e777d0009c4208a Mon Sep 17 00:00:00 2001 From: Cloudwalk Date: Thu, 6 Aug 2020 09:33:51 -0400 Subject: [PATCH] (WIP) cmd: Don't use strlcpy return for size since it's the size of the whole string --- cmd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd.c b/cmd.c index 6198f7de..abeb6cc9 100644 --- a/cmd.c +++ b/cmd.c @@ -300,7 +300,8 @@ static cbuf_cmd_t *Cbuf_ParseText(cmd_state_t *cmd, const char *text) } // Data write stage - current->size = strlcpy(current->text, offset, cmdsize + 1); + current->size = cmdsize + 1; + strlcpy(current->text, offset, current->size); current->source = cmd; // Link stage -- 2.39.2