diff --git a/src/file_ses.c b/src/file_ses.c index 9f8522ab..76ee4d61 100644 --- a/src/file_ses.c +++ b/src/file_ses.c @@ -26,16 +26,12 @@ #ifdef HAVE_STRING_H #include #endif -#ifdef HAVE_TIME_H -#include -#endif #include #include "types.h" #include "common.h" #include "filegen.h" static void register_header_check_ses(file_stat_t *file_stat); -static int header_check_ses(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_ses= { .extension="ses", @@ -47,22 +43,14 @@ const file_hint_t file_hint_ses= { .register_header_check=®ister_header_check_ses }; -static const unsigned char ses_magic[8]= { - 'C', 'O', 'O', 'L', 'N', 'E', 'S', 'S' -}; +static int header_check_ses(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) +{ + reset_file_recovery(file_recovery_new); + file_recovery_new->extension=file_hint_ses.extension; + return 1; +} static void register_header_check_ses(file_stat_t *file_stat) { - register_header_check(0, ses_magic, sizeof(ses_magic), &header_check_ses, file_stat); -} - -static int header_check_ses(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, ses_magic, sizeof(ses_magic))==0) - { - reset_file_recovery(file_recovery_new); - file_recovery_new->extension=file_hint_ses.extension; - return 1; - } - return 0; + register_header_check(0, "COOLNESS", 8, &header_check_ses, file_stat); }