summaryrefslogtreecommitdiffstats
path: root/src/file_pap.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2014-07-26 19:15:16 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2014-07-26 19:15:16 +0200
commit17eb3e5c48d22addc090a1c88045c66a6644a531 (patch)
tree90e1e1c23fd4a158cab51ba9f00fc611693d8496 /src/file_pap.c
parentb7e5378f395a3b9e57b064d083f79e225a94ef4f (diff)
PhotoRec: code cleanup for .pap
Diffstat (limited to 'src/file_pap.c')
-rw-r--r--src/file_pap.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/file_pap.c b/src/file_pap.c
index 18173da..5ce561a 100644
--- a/src/file_pap.c
+++ b/src/file_pap.c
@@ -32,7 +32,6 @@
static void register_header_check_pap(file_stat_t *file_stat);
-static int header_check_pap(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);
const file_hint_t file_hint_pap= {
.extension="pap",
@@ -44,20 +43,15 @@ const file_hint_t file_hint_pap= {
.register_header_check=&register_header_check_pap
};
-static const unsigned char pap_header[] = {'P','A','P','1'};
-
-static void register_header_check_pap(file_stat_t *file_stat)
+static int header_check_pap(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)
{
- register_header_check(0, pap_header,sizeof(pap_header), &header_check_pap, file_stat);
+ reset_file_recovery(file_recovery_new);
+ file_recovery_new->extension=file_hint_pap.extension;
+ return 1;
}
-static int header_check_pap(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 register_header_check_pap(file_stat_t *file_stat)
{
- if(memcmp(buffer,pap_header,sizeof(pap_header))==0)
- {
- reset_file_recovery(file_recovery_new);
- file_recovery_new->extension=file_hint_pap.extension;
- return 1;
- }
- return 0;
+ static const unsigned char pap_header[] = {'P','A','P','1'};
+ register_header_check(0, pap_header,sizeof(pap_header), &header_check_pap, file_stat);
}