summaryrefslogtreecommitdiffstats
path: root/src/file_gz.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_gz.c
parent56e27e660059e73f1315f83c660fc358c02e41d7 (diff)
PhotoRec: log the correct filename if file has been renamed
Diffstat (limited to 'src/file_gz.c')
-rw-r--r--src/file_gz.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/file_gz.c b/src/file_gz.c
index 2dd8ac9..a3f79c8 100644
--- a/src/file_gz.c
+++ b/src/file_gz.c
@@ -36,7 +36,7 @@
static void register_header_check_gz(file_stat_t *file_stat);
static int header_check_gz(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);
-static void file_rename_gz(const char *old_filename);
+static void file_rename_gz(file_recovery_t *file_recovery);
const file_hint_t file_hint_gz= {
.extension="gz",
@@ -239,12 +239,12 @@ static int header_check_gz(const unsigned char *buffer, const unsigned int buffe
return 1;
}
-static void file_rename_gz(const char *old_filename)
+static void file_rename_gz(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;
buffer_size=fread(buffer, 1, sizeof(buffer), file);
fclose(file);
@@ -262,7 +262,7 @@ static void file_rename_gz(const char *old_filename)
}
if((flags&GZ_FNAME)!=0)
{
- file_rename(old_filename, buffer, buffer_size, off, NULL, 1);
+ file_rename(file_recovery, buffer, buffer_size, off, NULL, 1);
}
}
}