diff --git a/src/filesystem.cpp b/src/filesystem.cpp index d7fd36b..6ecb280 100644 --- a/src/filesystem.cpp +++ b/src/filesystem.cpp @@ -496,18 +496,18 @@ static void fontSetEnumCB(void *data, const char *dir, } /* Basically just a case-insensitive search - * for the folder "Fonts"... */ + * for all folders starting with "Fonts"... */ static void findFontsFolderCB(void *data, const char *, const char *fname) { size_t i = 0; - char buffer[512]; + char buffer[6]; const char *s = fname; while (s && i < sizeof(buffer)) buffer[i++] = tolower(*s++); - buffer[i] = '\0'; + buffer[5] = '\0'; if (strcmp(buffer, "fonts") == 0) PHYSFS_enumerateFilesCallback(fname, fontSetEnumCB, data); @@ -517,7 +517,7 @@ void FileSystem::initFontSets(SharedFontState &sfs) { FontSetsCBData d = { p, &sfs }; - PHYSFS_enumerateFilesCallback(".", findFontsFolderCB, &d); + PHYSFS_enumerateFilesCallback("", findFontsFolderCB, &d); } struct OpenReadEnumData