qsort cannot be called with NULL

resolves #519
This commit is contained in:
Adam Mizerski 2021-09-25 13:53:33 +02:00 committed by Tim Angus
parent 788f29de94
commit 26780805c8

View file

@ -2932,7 +2932,9 @@ void FS_AddGameDirectory( const char *path, const char *dir ) {
// Get .pk3 files
pakfiles = Sys_ListFiles(curpath, ".pk3", NULL, &numfiles, qfalse);
qsort( pakfiles, numfiles, sizeof(char*), paksort );
if ( pakfiles ) {
qsort( pakfiles, numfiles, sizeof(char*), paksort );
}
if ( fs_numServerPaks ) {
numdirs = 0;