============
Cbuf_LinkString
-Copies a command string into a buffer node
+Copies a command string into a buffer node.
+The input should not be null-terminated, the output will be.
============
*/
static void Cbuf_LinkString(cmd_state_t *cmd, llist_t *head, cmd_input_t *existing, const char *text, qbool leavepending, unsigned int cmdsize)
}
cbuf->size += cmdsize;
- dp_strlcpy(&node->text[offset], text, cmdsize + 1); // always sets the last char to \0
+ dp_ustr2stp(&node->text[offset], node->length + 1, text, cmdsize);
//Con_Printf("^5Cbuf_LinkString(): %s `^7%s^5`\n", node->pending ? "append" : "new", &node->text[offset]);
node->pending = leavepending;
}