summaryrefslogtreecommitdiffstats
path: root/src/file_dbn.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/file_dbn.c')
-rw-r--r--src/file_dbn.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/src/file_dbn.c b/src/file_dbn.c
index 8b233ba..b9a1f74 100644
--- a/src/file_dbn.c
+++ b/src/file_dbn.c
@@ -32,7 +32,6 @@
#include "memmem.h"
static void register_header_check_dbn(file_stat_t *file_stat);
-static int header_check_dbn(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_dbn= {
.extension="dbn",
@@ -44,24 +43,20 @@ const file_hint_t file_hint_dbn= {
.register_header_check=&register_header_check_dbn
};
-static const unsigned char dbn_header[16]= {
- 'F' , 'i' , 'l' , 'e' , ' ' , 'c' , 'r' , 'e' ,
- 'a' , 't' , 'e' , 'd' , ' ' , 'o' , 'n' , ' '
-};
-
-static void register_header_check_dbn(file_stat_t *file_stat)
+static int header_check_dbn(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, dbn_header, sizeof(dbn_header), &header_check_dbn, file_stat);
+ if(td_memmem(buffer, 512, "[HEADER]", 8)==NULL)
+ return 0;
+ reset_file_recovery(file_recovery_new);
+ file_recovery_new->extension=file_hint_dbn.extension;
+ return 1;
}
-static int header_check_dbn(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_dbn(file_stat_t *file_stat)
{
- if(memcmp(buffer, dbn_header, sizeof(dbn_header))==0 &&
- td_memmem(buffer, 512, "[HEADER]", 8)!=NULL)
- {
- reset_file_recovery(file_recovery_new);
- file_recovery_new->extension=file_hint_dbn.extension;
- return 1;
- }
- return 0;
+ static const unsigned char dbn_header[16]= {
+ 'F' , 'i' , 'l' , 'e' , ' ' , 'c' , 'r' , 'e' ,
+ 'a' , 't' , 'e' , 'd' , ' ' , 'o' , 'n' , ' '
+ };
+ register_header_check(0, dbn_header, sizeof(dbn_header), &header_check_dbn, file_stat);
}