mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-06-02 16:48:43 +02:00
Handle EOVERFLOW
This commit is contained in:
parent
a40d037d21
commit
a0d68063ae
|
@ -44,6 +44,7 @@
|
|||
#include "filesel.h"
|
||||
#include "file_slot.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <iso9660.h>
|
||||
#ifdef HW_RVL
|
||||
#include <di/di.h>
|
||||
|
@ -231,11 +232,19 @@ int ParseDirectory(void)
|
|||
return -1;
|
||||
}
|
||||
|
||||
struct dirent *entry = readdir(dir);
|
||||
struct dirent *entry = NULL;
|
||||
|
||||
/* list entries */
|
||||
while ((entry != NULL)&& (nbfiles < MAXFILES))
|
||||
do
|
||||
{
|
||||
errno = 0;
|
||||
/* next entry */
|
||||
entry = readdir(dir);
|
||||
if (entry == NULL)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* filter entries */
|
||||
if ((entry->d_name[0] != '.')
|
||||
&& strncasecmp(".wav", &entry->d_name[strlen(entry->d_name) - 4], 4)
|
||||
|
@ -250,10 +259,8 @@ int ParseDirectory(void)
|
|||
}
|
||||
nbfiles++;
|
||||
}
|
||||
|
||||
/* next entry */
|
||||
entry = readdir(dir);
|
||||
}
|
||||
while ((entry != NULL || errno == EOVERFLOW) && (nbfiles < MAXFILES));
|
||||
|
||||
/* close directory */
|
||||
closedir(dir);
|
||||
|
|
Loading…
Reference in New Issue
Block a user