summaryrefslogtreecommitdiffstats
path: root/src/file_dir.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2015-06-12 19:49:50 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2015-06-12 19:49:50 +0200
commit04d653114489586908a37b6f405340fdcb9a3824 (patch)
tree6ecd19bcbadcfdb1b575402ff5856991f80cbbee /src/file_dir.c
parent56e27e660059e73f1315f83c660fc358c02e41d7 (diff)
PhotoRec: log the correct filename if file has been renamed
Diffstat (limited to 'src/file_dir.c')
-rw-r--r--src/file_dir.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/file_dir.c b/src/file_dir.c
index 5035bf7..956e6e3 100644
--- a/src/file_dir.c
+++ b/src/file_dir.c
@@ -51,14 +51,14 @@ const file_hint_t file_hint_dir= {
.register_header_check=&register_header_check_dir
};
-static void file_rename_fatdir(const char *old_filename)
+static void file_rename_fatdir(file_recovery_t *file_recovery)
{
unsigned char buffer[512];
char buffer_cluster[32];
FILE *file;
int buffer_size;
unsigned int cluster;
- if((file=fopen(old_filename, "rb"))==NULL)
+ if((file=fopen(file_recovery->filename, "rb"))==NULL)
return;
buffer_size=fread(buffer, 1, sizeof(buffer), file);
fclose(file);
@@ -66,7 +66,7 @@ static void file_rename_fatdir(const char *old_filename)
return;
cluster=fat_get_cluster_from_entry((const struct msdos_dir_entry *)&buffer[0]);
sprintf(buffer_cluster, "cluster_%u", cluster);
- file_rename(old_filename, buffer_cluster, strlen(buffer_cluster), 0, NULL, 1);
+ file_rename(file_recovery, buffer_cluster, strlen(buffer_cluster), 0, NULL, 1);
}
static data_check_t data_check_fatdir(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery)