From: Cloudwalk Date: Thu, 6 Aug 2020 13:33:51 +0000 (-0400) Subject: (WIP) cmd: Don't use strlcpy return for size since it's the size of the whole string X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1ea247e116478641609e072f5e777d0009c4208a;p=xonotic%2Fdarkplaces.git (WIP) cmd: Don't use strlcpy return for size since it's the size of the whole string --- 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