From 43ea541463e5c2f4fe0f050da19bca2d557cb9d2 Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Thu, 17 Sep 2020 05:18:01 +0000 Subject: [PATCH] cmd: Add missing List_IsEmpty check git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12924 d7cf8633-e32d-0410-b094-e92efae38249 --- cmd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd.c b/cmd.c index e92c1340..01a28ae6 100644 --- a/cmd.c +++ b/cmd.c @@ -386,7 +386,8 @@ void Cbuf_InsertText (cmd_state_t *cmd, const char *text) else { Cbuf_LinkCreate(cmd, &llist, List_Container(*cbuf->start.next, cmd_input_t, list), text); - List_Splice(&llist, &cbuf->start); + if(!List_IsEmpty(&llist)) + List_Splice(&llist, &cbuf->start); } Cbuf_Unlock(cbuf); -- 2.39.2