prevent segfault caused by stringlistsort
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 27 Jun 2011 14:05:26 +0000 (14:05 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 27 Jun 2011 14:05:26 +0000 (14:05 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11224 d7cf8633-e32d-0410-b094-e92efae38249

filematch.c

index 42f9f9d..9971167 100644 (file)
@@ -125,6 +125,8 @@ static int stringlistsort_cmp(const void *a, const void *b)
 void stringlistsort(stringlist_t *list, qboolean uniq)
 {
        int i, j;
+       if(list->numstrings < 1)
+               return;
        qsort(&list->strings[0], list->numstrings, sizeof(list->strings[0]), stringlistsort_cmp);
        if(uniq)
        {