summaryrefslogtreecommitdiffstats
path: root/src/file_ptb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/file_ptb.c')
-rw-r--r--src/file_ptb.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/file_ptb.c b/src/file_ptb.c
index 5a32b00..4d6fab3 100644
--- a/src/file_ptb.c
+++ b/src/file_ptb.c
@@ -31,7 +31,6 @@
#include "filegen.h"
static void register_header_check_ptb(file_stat_t *file_stat);
-static int header_check_ptb(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_ptb= {
.extension="ptb",
@@ -43,17 +42,10 @@ const file_hint_t file_hint_ptb= {
.register_header_check=&register_header_check_ptb
};
-static const unsigned char ptb_header[4]= {'p', 't', 'a', 'b'};
-
-static void register_header_check_ptb(file_stat_t *file_stat)
-{
- register_header_check(0, ptb_header,sizeof(ptb_header), &header_check_ptb, file_stat);
-}
-
static int header_check_ptb(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 unsigned int file_version=buffer[4]|(buffer[5]<<8);
- if(memcmp(buffer,ptb_header,sizeof(ptb_header))==0 && file_version>=1 && file_version<=4)
+ if(file_version>=1 && file_version<=4)
{
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_ptb.extension;
@@ -61,3 +53,9 @@ static int header_check_ptb(const unsigned char *buffer, const unsigned int buff
}
return 0;
}
+
+static void register_header_check_ptb(file_stat_t *file_stat)
+{
+ static const unsigned char ptb_header[4]= {'p', 't', 'a', 'b'};
+ register_header_check(0, ptb_header,sizeof(ptb_header), &header_check_ptb, file_stat);
+}