]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
(WIP) cmd: Don't use strlcpy return for size since it's the size of the whole string
authorCloudwalk <cloudwalk009@gmail.com>
Thu, 6 Aug 2020 13:33:51 +0000 (09:33 -0400)
committerCloudwalk <cloudwalk009@gmail.com>
Thu, 6 Aug 2020 13:33:51 +0000 (09:33 -0400)
cmd.c

diff --git a/cmd.c b/cmd.c
index 6198f7de7a5a3aaff1df74697d8373dc881c32f5..abeb6cc94864be25b494035bbcc79f13d4adc8f5 100644 (file)
--- 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