summaryrefslogtreecommitdiffstats
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
parentd3cc7faf5f0e78aee201aeeba682334b87ff0bac (diff)
Modify file_search_footer() prototype
-rw-r--r--src/filegen.c4
-rw-r--r--src/filegen.h2
2 files changed, 3 insertions, 3 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);
diff --git a/src/filegen.h b/src/filegen.h
index d7911d8..aeb8ad2 100644
--- a/src/filegen.h
+++ b/src/filegen.h
@@ -124,7 +124,7 @@ typedef struct
void free_header_check(void);
void file_allow_nl(file_recovery_t *file_recovery, const unsigned int nl_mode);
-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);
void file_search_lc_footer(file_recovery_t *file_recovery, const unsigned char*footer, const unsigned int footer_length);
void del_search_space(alloc_data_t *list_search_space, const uint64_t start, const uint64_t end);
int data_check_size(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery);