]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix a crash in maps command
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 15 Mar 2007 12:49:57 +0000 (12:49 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 15 Mar 2007 12:49:57 +0000 (12:49 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6982 d7cf8633-e32d-0410-b094-e92efae38249

console.c

index 75beb33032079366cb0835325e02e6fb7edcb300..1581aab2823031ed42007eb8219b4baf6ba9c090 100644 (file)
--- a/console.c
+++ b/console.c
@@ -1224,7 +1224,7 @@ qboolean GetMapList (const char *s, char *completedname, int completednamebuffer
                                goto endcomplete;
        }
 endcomplete:
-       if(p > o)
+       if(p > o && completedname && completednamebufferlength > 0)
        {
                memset(completedname, 0, completednamebufferlength);
                memcpy(completedname, (t->filenames[0]+5), min(p, completednamebufferlength - 1));