summaryrefslogtreecommitdiffstats
path: root/src/file_ptf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/file_ptf.c')
-rw-r--r--src/file_ptf.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/file_ptf.c b/src/file_ptf.c
index 0ef18f6..0fddd37 100644
--- a/src/file_ptf.c
+++ b/src/file_ptf.c
@@ -42,24 +42,19 @@ const file_hint_t file_hint_ptf= {
.register_header_check=&register_header_check_ptf
};
-static const unsigned char ptf_header[19]= {
- 0x03, '0' , '0' , '1' , '0' , '1' , '1' , '1' ,
- '1', '0' , '0' , '1' , '0' , '1' , '0' , '1' ,
- '1', 0x00, 0x01
-};
-
static int header_check_ptf(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)
{
- if(memcmp(&buffer[0], ptf_header, sizeof(ptf_header))==0)
- {
- reset_file_recovery(file_recovery_new);
- file_recovery_new->extension=file_hint_ptf.extension;
- return 1;
- }
- return 0;
+ reset_file_recovery(file_recovery_new);
+ file_recovery_new->extension=file_hint_ptf.extension;
+ return 1;
}
static void register_header_check_ptf(file_stat_t *file_stat)
{
+ static const unsigned char ptf_header[19]= {
+ 0x03, '0' , '0' , '1' , '0' , '1' , '1' , '1' ,
+ '1', '0' , '0' , '1' , '0' , '1' , '0' , '1' ,
+ '1', 0x00, 0x01
+ };
register_header_check(0, ptf_header, sizeof(ptf_header), &header_check_ptf, file_stat);
}