Minor tweaks
This commit is contained in:
parent
5895fb6adc
commit
4c728f0b54
1 changed files with 4 additions and 4 deletions
|
@ -2069,7 +2069,7 @@ char **GetDirectoryFiles(const char *dirPath, int *fileCount)
|
||||||
for (int i = 0; i < MAX_DIRECTORY_FILES; i++) dirFilesPath[i] = (char *)RL_MALLOC(sizeof(char)*MAX_FILEPATH_LENGTH);
|
for (int i = 0; i < MAX_DIRECTORY_FILES; i++) dirFilesPath[i] = (char *)RL_MALLOC(sizeof(char)*MAX_FILEPATH_LENGTH);
|
||||||
|
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
struct dirent *ent;
|
struct dirent *entity;
|
||||||
DIR *dir = opendir(dirPath);
|
DIR *dir = opendir(dirPath);
|
||||||
|
|
||||||
if (dir != NULL) // It's a directory
|
if (dir != NULL) // It's a directory
|
||||||
|
@ -2078,9 +2078,9 @@ char **GetDirectoryFiles(const char *dirPath, int *fileCount)
|
||||||
// first one to count files and second one to read names
|
// first one to count files and second one to read names
|
||||||
// That way we can allocate required memory, instead of a limited pool
|
// That way we can allocate required memory, instead of a limited pool
|
||||||
|
|
||||||
while ((ent = readdir(dir)) != NULL)
|
while ((entity = readdir(dir)) != NULL)
|
||||||
{
|
{
|
||||||
strcpy(dirFilesPath[counter], ent->d_name);
|
strcpy(dirFilesPath[counter], entity->d_name);
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue