summaryrefslogtreecommitdiffstats
path: root/src/file_mk5.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/file_mk5.c')
-rw-r--r--src/file_mk5.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/file_mk5.c b/src/file_mk5.c
index 44d11fd..e6882be 100644
--- a/src/file_mk5.c
+++ b/src/file_mk5.c
@@ -30,7 +30,6 @@
#include "filegen.h"
static void register_header_check_mk5(file_stat_t *file_stat);
-static int header_check_mk5(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_mk5= {
.extension="mk5",
@@ -42,22 +41,18 @@ const file_hint_t file_hint_mk5= {
.register_header_check=&register_header_check_mk5
};
-static const unsigned char mk5_header[4]= { 0x36, 0xff, 0xff, 0xff };
-static const unsigned char mk5_header2[4]= { 0x00, 0x40, 0x1c, 0x46 };
-
-static void register_header_check_mk5(file_stat_t *file_stat)
+static int header_check_mk5(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, mk5_header,sizeof(mk5_header), &header_check_mk5, file_stat);
+ static const unsigned char mk5_header2[4]= { 0x00, 0x40, 0x1c, 0x46 };
+ if(memcmp(buffer+0x1c,mk5_header2,sizeof(mk5_header2))!=0)
+ return 0;
+ reset_file_recovery(file_recovery_new);
+ file_recovery_new->extension=file_hint_mk5.extension;
+ return 1;
}
-static int header_check_mk5(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_mk5(file_stat_t *file_stat)
{
- if(memcmp(buffer,mk5_header,sizeof(mk5_header))==0 &&
- memcmp(buffer+0x1c,mk5_header2,sizeof(mk5_header2))==0)
- {
- reset_file_recovery(file_recovery_new);
- file_recovery_new->extension=file_hint_mk5.extension;
- return 1;
- }
- return 0;
+ static const unsigned char mk5_header[4]= { 0x36, 0xff, 0xff, 0xff };
+ register_header_check(0, mk5_header,sizeof(mk5_header), &header_check_mk5, file_stat);
}