Allow calling getFilesInDir with null files

This commit is contained in:
Henrik Rydgård committed 2013-12-13 16:09:09 +01:00
1 parent 8166e7a094
commit da2b26299d
1 file changed
+4 -2
+4 -2
View File
@@ -316,7 +316,8 @@ size_t getFilesInDir(const char *directory, std::vector<FileInfo> *files, const
}
}
files->push_back(info);
if (files)
files->push_back(info);
#ifdef _WIN32
} while (FindNextFile(hFind, &ffd) != 0);
FindClose(hFind);
@@ -324,7 +325,8 @@ size_t getFilesInDir(const char *directory, std::vector<FileInfo> *files, const
}
closedir(dirp);
#endif
std::sort(files->begin(), files->end());
if (files)
std::sort(files->begin(), files->end());
return foundEntries;
}