summaryrefslogtreecommitdiffstats
path: root/src/file_pzh.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_pzh.c
parent56e27e660059e73f1315f83c660fc358c02e41d7 (diff)
PhotoRec: log the correct filename if file has been renamed
Diffstat (limited to 'src/file_pzh.c')
-rw-r--r--src/file_pzh.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/file_pzh.c b/src/file_pzh.c
index 692878e..b6ed094 100644
--- a/src/file_pzh.c
+++ b/src/file_pzh.c
@@ -49,12 +49,12 @@ static const unsigned char pzh_header[10]= {
0x05, 0x03
};
-static void file_rename_pzh(const char *old_filename)
+static void file_rename_pzh(file_recovery_t *file_recovery)
{
unsigned char buffer[512];
FILE *file;
int buffer_size;
- if((file=fopen(old_filename, "rb"))==NULL)
+ if((file=fopen(file_recovery->filename, "rb"))==NULL)
return;
if(fseek(file, 0x9ce, SEEK_SET)<0)
{
@@ -64,7 +64,7 @@ static void file_rename_pzh(const char *old_filename)
buffer_size=fread(buffer, 1, sizeof(buffer), file);
fclose(file);
if(buffer_size > 0)
- file_rename(old_filename, buffer, buffer_size, 0, "pzh", 0);
+ file_rename(file_recovery, buffer, buffer_size, 0, "pzh", 0);
}
static int header_check_pzh(const unsigned char *buffer, const unsigned int buffer_size, const unsigned int safe_header_only, const file_recovery_t *file_recovery, file_recovery_t *file_recovery_new)