summaryrefslogtreecommitdiffstats
path: root/src/filegen.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2011-03-05 19:03:32 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2011-03-05 19:03:32 +0100
commit5e2c51f640c4b4bc865a3735ba290609a6a6b7fc (patch)
treea8ce2bc96c8b1a9fecb6be7740756a8eba75d732 /src/filegen.c
parentd3cc7faf5f0e78aee201aeeba682334b87ff0bac (diff)
Modify file_search_footer() prototype
Diffstat (limited to 'src/filegen.c')
-rw-r--r--src/filegen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/filegen.c b/src/filegen.c
index 5a61fd6..d6b4771 100644
--- a/src/filegen.c
+++ b/src/filegen.c
@@ -188,7 +188,7 @@ void file_allow_nl(file_recovery_t *file_recovery, const unsigned int nl_mode)
file_recovery->file_size++;
}
-void file_search_footer(file_recovery_t *file_recovery, const unsigned char*footer, const unsigned int footer_length, const unsigned int extra_length)
+void file_search_footer(file_recovery_t *file_recovery, const void*footer, const unsigned int footer_length, const unsigned int extra_length)
{
unsigned char*buffer;
int64_t file_size;
@@ -211,7 +211,7 @@ void file_search_footer(file_recovery_t *file_recovery, const unsigned char*foot
taille=fread(buffer,1,read_size,file_recovery->handle);
for(i=taille-1;i>=0;i--)
{
- if(buffer[i]==footer[0] && memcmp(buffer+i,footer,footer_length)==0)
+ if(buffer[i]==*(const unsigned char *)footer && memcmp(buffer+i,footer,footer_length)==0)
{
file_recovery->file_size=file_size + i + footer_length + extra_length;
free(buffer);