From: cloudwalk Date: Thu, 17 Sep 2020 05:18:01 +0000 (+0000) Subject: cmd: Add missing List_IsEmpty check X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=43ea541463e5c2f4fe0f050da19bca2d557cb9d2;p=xonotic%2Fdarkplaces.git cmd: Add missing List_IsEmpty check git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12924 d7cf8633-e32d-0410-b094-e92efae38249 --- 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);