Patch by Magliocchetti Riccardo:

Removed shadow on fpath.
This commit is contained in:
yabause 2008-11-10 21:47:21 +00:00
parent dfb4ada998
commit 54f56cb716
1 changed files with 5 additions and 5 deletions

View File

@ -248,7 +248,7 @@ static void add_file(char *fname, FsEntry * entry, int fileLevel) {
/* List all files and subdirectories recursively */
static void list_files(char *fpath) {
static void list_files(const char *filepath) {
void * hFind;
FsEntry entry;
char DirSpec[255 + 1],SubDir[255+1];
@ -259,7 +259,7 @@ static void list_files(char *fpath) {
maxLevel++;
fileLevel = maxLevel;
strncpy(DirSpec, fpath, ARRAY_SIZE(DirSpec));
strncpy(DirSpec, filepath, ARRAY_SIZE(DirSpec));
DirSpec[255] = 0 ; /* hard limit the string here */
hFind = FsReadFirst(DirSpec, &entry);
@ -277,9 +277,9 @@ static void list_files(char *fpath) {
if (numFiles==MAXFILES-1) break;
if ((entry.flags & FS_IS_DIR) && (strcmp(fname, ".")) && (strcmp(fname, ".."))) {
if (strlen(fname)+strlen(fpath)+2 < 256)
if (strlen(fname)+strlen(filepath)+2 < 256)
{
sprintf(SubDir, "%s%c%s", fpath, FS_SEPARATOR, fname);
sprintf(SubDir, "%s%c%s", filepath, FS_SEPARATOR, fname);
list_files(SubDir);
}
}