]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
cmd: Add missing List_IsEmpty check
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 17 Sep 2020 05:18:01 +0000 (05:18 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 17 Sep 2020 05:18:01 +0000 (05:18 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12924 d7cf8633-e32d-0410-b094-e92efae38249

cmd.c

diff --git a/cmd.c b/cmd.c
index e92c1340ff5f876ea6f5559a565c29f31073b817..01a28ae693986d7f7e805d9624f6d47a6623e1c3 100644 (file)
--- 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);