summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/file_dad.c3
-rw-r--r--src/file_dv.c3
-rw-r--r--src/file_edb.c2
-rw-r--r--src/file_ext2.c2
-rw-r--r--src/file_fdb.c2
-rw-r--r--src/file_jpg.c2
-rw-r--r--src/file_m2ts.c4
-rw-r--r--src/file_mov.c3
-rw-r--r--src/file_mp3.c2
-rw-r--r--src/file_mpg.c10
-rw-r--r--src/file_ogg.c2
-rw-r--r--src/file_par2.c3
-rw-r--r--src/file_png.c2
-rw-r--r--src/file_psf.c2
-rw-r--r--src/file_tar.c2
-rw-r--r--src/file_tiff.c2
-rw-r--r--src/file_txt.c16
-rw-r--r--src/file_wtv.c2
-rw-r--r--src/file_zip.c4
19 files changed, 32 insertions, 36 deletions
diff --git a/src/file_dad.c b/src/file_dad.c
index ba3f573..2f4fa0e 100644
--- a/src/file_dad.c
+++ b/src/file_dad.c
@@ -74,8 +74,7 @@ static data_check_t data_check_dad(const unsigned char *buffer, const unsigned i
static int header_check_dad(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 struct dad_header *dad=(const struct dad_header *)buffer;
- if(file_recovery!=NULL &&
- file_recovery->file_stat!=NULL &&
+ if(file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_dad &&
(file_recovery->calculated_file_size==file_recovery->file_size ||
file_recovery->blocksize < 16))
diff --git a/src/file_dv.c b/src/file_dv.c
index 61e5f2d..2244764 100644
--- a/src/file_dv.c
+++ b/src/file_dv.c
@@ -59,8 +59,7 @@ static data_check_t data_check_dv(const unsigned char *buffer, const unsigned in
static int header_check_dv(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(file_recovery!=NULL &&
- file_recovery->file_stat!=NULL &&
+ if(file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_dv)
return 0;
/* The header may be only 3 bytes */
diff --git a/src/file_edb.c b/src/file_edb.c
index cd38f99..ce3ace0 100644
--- a/src/file_edb.c
+++ b/src/file_edb.c
@@ -47,7 +47,7 @@ const file_hint_t file_hint_edb= {
static int header_check_edb(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)
{
/* A backup of the header is stored in the second block */
- if(file_recovery!=NULL && file_recovery->file_stat!=NULL &&
+ if(file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_edb &&
file_recovery->file_size==4096)
return 0;
diff --git a/src/file_ext2.c b/src/file_ext2.c
index 41506b1..93522fe 100644
--- a/src/file_ext2.c
+++ b/src/file_ext2.c
@@ -60,7 +60,7 @@ static int header_check_ext2_fs(const unsigned char *buffer, const unsigned int
return 0;
if(le16(sb->s_block_group_nr)!=0)
return 0;
- if(file_recovery!=NULL && file_recovery->file_stat!=NULL &&
+ if(file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_ext2_fs &&
file_recovery->calculated_file_size==(uint64_t)le32(sb->s_blocks_count)*(EXT2_MIN_BLOCK_SIZE<<le32(sb->s_log_block_size)))
return 0;
diff --git a/src/file_fdb.c b/src/file_fdb.c
index 46072c7..f2b9315 100644
--- a/src/file_fdb.c
+++ b/src/file_fdb.c
@@ -52,7 +52,7 @@ static void register_header_check_fdb(file_stat_t *file_stat)
static int header_check_fdb(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(file_recovery!=NULL && file_recovery->file_stat!=NULL &&
+ if(file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_fdb)
return 0;
if(memcmp(&buffer[5], fdb_header, sizeof(fdb_header))==0)
diff --git a/src/file_jpg.c b/src/file_jpg.c
index e74a241..1f6c573 100644
--- a/src/file_jpg.c
+++ b/src/file_jpg.c
@@ -366,7 +366,7 @@ static int header_check_jpg(const unsigned char *buffer, const unsigned int buff
{
unsigned int i=2;
time_t jpg_time=0;
- if(file_recovery!=NULL && file_recovery->file_stat!=NULL)
+ if(file_recovery->file_stat!=NULL)
{
static const unsigned char jpg_header_app0_avi[0x0c]= {
0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 'A', 'V', 'I', '1', 0x00, 0x00
diff --git a/src/file_m2ts.c b/src/file_m2ts.c
index 77c7358..e307e44 100644
--- a/src/file_m2ts.c
+++ b/src/file_m2ts.c
@@ -124,7 +124,7 @@ static void file_rename_ts_192(const char *old_filename)
static int header_check_m2ts(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)
{
unsigned int i;
- if(file_recovery!=NULL && file_recovery->file_stat!=NULL &&
+ if(file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_m2ts &&
(file_recovery->data_check==&data_check_ts_192 ||
file_recovery->blocksize < 5))
@@ -178,7 +178,7 @@ static data_check_t data_check_ts_188(const unsigned char *buffer, const unsigne
static int header_check_m2t(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)
{
unsigned int i;
- if(file_recovery!=NULL && file_recovery->file_stat!=NULL &&
+ if(file_recovery->file_stat!=NULL &&
file_recovery->data_check==&data_check_ts_188 &&
file_recovery->calculated_file_size == file_recovery->file_size)
return 0;
diff --git a/src/file_mov.c b/src/file_mov.c
index 2b599a0..077f0ae 100644
--- a/src/file_mov.c
+++ b/src/file_mov.c
@@ -101,8 +101,7 @@ static int header_check_mov(const unsigned char *buffer, const unsigned int buff
if(buffer[4]=='f' && buffer[5]=='t' && buffer[6]=='y' && buffer[7]=='p')
{
}
- else if(file_recovery!=NULL &&
- file_recovery->file_stat!=NULL &&
+ else if(file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_mov &&
(file_recovery->calculated_file_size == file_recovery->file_size ||
file_recovery->blocksize < 16))
diff --git a/src/file_mp3.c b/src/file_mp3.c
index 2a236d0..5181012 100644
--- a/src/file_mp3.c
+++ b/src/file_mp3.c
@@ -164,7 +164,7 @@ static int header_check_mp3(const unsigned char *buffer, const unsigned int buff
(buffer[1]&0xFE)==0xF2 ||
(buffer[1]&0xFE)==0xE2)))
return 0;
- if(file_recovery!=NULL && file_recovery->file_stat!=NULL)
+ if(file_recovery->file_stat!=NULL)
{
if(file_recovery->file_stat->file_hint==&file_hint_mp3 ||
file_recovery->file_stat->file_hint==&file_hint_mkv)
diff --git a/src/file_mpg.c b/src/file_mpg.c
index d7f1768..20e1fbe 100644
--- a/src/file_mpg.c
+++ b/src/file_mpg.c
@@ -177,7 +177,7 @@ static int header_check_mpg_Pack(const unsigned char *buffer, const unsigned int
file_recovery_new->file_check=&file_check_size;
return 1;
}
- if(file_recovery!=NULL && file_recovery->file_stat!=NULL && file_recovery->file_stat->file_hint==&file_hint_mpg)
+ if(file_recovery->file_stat!=NULL && file_recovery->file_stat->file_hint==&file_hint_mpg)
return 0;
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_mpg.extension;
@@ -220,7 +220,7 @@ static int header_check_mpg_Pack(const unsigned char *buffer, const unsigned int
file_recovery_new->file_check=&file_check_size;
return 1;
}
- if(file_recovery!=NULL && file_recovery->file_stat!=NULL && file_recovery->file_stat->file_hint==&file_hint_mpg)
+ if(file_recovery->file_stat!=NULL && file_recovery->file_stat->file_hint==&file_hint_mpg)
return 0;
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_mpg.extension;
@@ -235,7 +235,7 @@ static int header_check_mpg_Pack(const unsigned char *buffer, const unsigned int
static int header_check_mpg_System(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(file_recovery!=NULL && file_recovery->file_stat!=NULL && file_recovery->file_stat->file_hint==&file_hint_mpg)
+ if(file_recovery->file_stat!=NULL && file_recovery->file_stat->file_hint==&file_hint_mpg)
return 0;
/* MPEG-1 http://andrewduncan.ws/MPEG/MPEG-1.ps */
/* ISO/IEC INTERNATIONAL 13818-1 STANDARD
@@ -277,7 +277,7 @@ static int header_check_mpg_System(const unsigned char *buffer, const unsigned i
static int header_check_mpg_Sequence(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(file_recovery!=NULL && file_recovery->file_stat!=NULL && file_recovery->file_stat->file_hint==&file_hint_mpg)
+ if(file_recovery->file_stat!=NULL && file_recovery->file_stat->file_hint==&file_hint_mpg)
return 0;
/* MPEG-1 sequence header code 0x1B3 */
/* horizontal size>0 */
@@ -312,7 +312,7 @@ static int header_check_mpg_Sequence(const unsigned char *buffer, const unsigned
static int header_check_mpg4_ElemVideo(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(file_recovery!=NULL && file_recovery->file_stat!=NULL && file_recovery->file_stat->file_hint==&file_hint_mpg)
+ if(file_recovery->file_stat!=NULL && file_recovery->file_stat->file_hint==&file_hint_mpg)
return 0;
/* ISO/IEC 14496-2 (MPEG-4 video) ELEMENTARY VIDEO HEADER - visual object start code */
/* is_visual_object_identifier */
diff --git a/src/file_ogg.c b/src/file_ogg.c
index 7893bbb..b629b71 100644
--- a/src/file_ogg.c
+++ b/src/file_ogg.c
@@ -53,7 +53,7 @@ static int header_check_ogg(const unsigned char *buffer, const unsigned int buff
/* http://en.wikipedia.org/wiki/Ogg#File_format */
/* Return if not Beginning Of Stream and already saving the file */
if((buffer[5]&0x02)!=0x02 &&
- file_recovery!=NULL && file_recovery->file_stat!=NULL &&
+ file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_ogg &&
(file_recovery->blocksize < 27+255 ||
file_recovery->calculated_file_size == file_recovery->file_size))
diff --git a/src/file_par2.c b/src/file_par2.c
index 9ff7009..67ce70b 100644
--- a/src/file_par2.c
+++ b/src/file_par2.c
@@ -113,8 +113,7 @@ static void file_rename_par2(const char *old_filename)
static int header_check_par2(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 uint64_t length=le64((*(const uint64_t *)(&buffer[8])));
- if(file_recovery!=NULL &&
- file_recovery->file_stat!=NULL &&
+ if(file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_par2)
return 0;
if(length % 4 !=0 || length < 16)
diff --git a/src/file_png.c b/src/file_png.c
index d3e4ce7..ae62522 100644
--- a/src/file_png.c
+++ b/src/file_png.c
@@ -130,7 +130,7 @@ static void file_check_png(file_recovery_t *fr)
static int header_check_png(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)
{
/* SolidWorks files contains a png */
- if(file_recovery!=NULL && file_recovery->file_stat!=NULL &&
+ if(file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_doc &&
(strcmp(file_recovery->extension,"sld")==0 ||
strcmp(file_recovery->extension,"sldprt")==0))
diff --git a/src/file_psf.c b/src/file_psf.c
index 19e434e..4725f8a 100644
--- a/src/file_psf.c
+++ b/src/file_psf.c
@@ -44,7 +44,7 @@ const file_hint_t file_hint_psf= {
static int header_check_psf(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(file_recovery!=NULL && file_recovery->file_stat!=NULL &&
+ if(file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_psf)
return 0;
reset_file_recovery(file_recovery_new);
diff --git a/src/file_tar.c b/src/file_tar.c
index f06f13f..4d3a356 100644
--- a/src/file_tar.c
+++ b/src/file_tar.c
@@ -54,7 +54,7 @@ static void register_header_check_tar(file_stat_t *file_stat)
int header_check_tar(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(file_recovery!=NULL && file_recovery->file_stat!=NULL && file_recovery->file_stat->file_hint==&file_hint_tar)
+ if(file_recovery->file_stat!=NULL && file_recovery->file_stat->file_hint==&file_hint_tar)
return 0;
if(memcmp(&buffer[0x101],tar_header_gnu,sizeof(tar_header_gnu))==0 ||
memcmp(&buffer[0x101],tar_header_posix,sizeof(tar_header_posix))==0)
diff --git a/src/file_tiff.c b/src/file_tiff.c
index c7f5280..8c90acc 100644
--- a/src/file_tiff.c
+++ b/src/file_tiff.c
@@ -328,7 +328,7 @@ static int header_check_tiff_le_new(const unsigned char *buffer, const unsigned
if(le32(header->tiff_diroff) < sizeof(TIFFHeader))
return 0;
/* Avoid a false positiv with some RAF files */
- if(file_recovery!=NULL && file_recovery->file_stat!=NULL &&
+ if(file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_raf &&
memcmp(buffer, raf_fp, 15)==0)
return 0;
diff --git a/src/file_txt.c b/src/file_txt.c
index 81e3c09..c4f74f8 100644
--- a/src/file_txt.c
+++ b/src/file_txt.c
@@ -584,7 +584,7 @@ static int header_check_dc(const unsigned char *buffer, const unsigned int buffe
static int header_check_html(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(file_recovery!=NULL && file_recovery->file_stat!=NULL &&
+ if(file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_fasttxt &&
strcmp(file_recovery->extension,"mbox")==0)
return 0;
@@ -704,7 +704,7 @@ static int header_check_rtf(const unsigned char *buffer, const unsigned int buff
if(buffer[i]=='\0')
return 0;
/* Avoid a false positive with .snt */
- if(file_recovery!=NULL && file_recovery->file_stat!=NULL &&
+ if(file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_doc)
return 0;
reset_file_recovery(file_recovery_new);
@@ -719,7 +719,7 @@ static int header_check_xmp(const unsigned char *buffer, const unsigned int buff
{
if(buffer[35]=='\0')
return 0;
- if(file_recovery!=NULL && file_recovery->file_stat!=NULL &&
+ if(file_recovery->file_stat!=NULL &&
(file_recovery->file_stat->file_hint==&file_hint_pdf ||
file_recovery->file_stat->file_hint==&file_hint_tiff))
return 0;
@@ -734,7 +734,7 @@ static int header_check_xmp(const unsigned char *buffer, const unsigned int buff
static int header_check_mbox(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)
{
unsigned int i;
- if(file_recovery!=NULL && file_recovery->file_stat!=NULL &&
+ if(file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_fasttxt &&
strcmp(file_recovery->extension,"mbox")==0)
return 0;
@@ -851,7 +851,7 @@ static int header_check_txt(const unsigned char *buffer, const unsigned int buff
if(buffer[i]==0x0a &&
(memcmp(buffer+i+1, "Return-Path: ", 13)==0 ||
memcmp(buffer+i+1, "Received: from", 14)==0) &&
- !(file_recovery!=NULL && file_recovery->file_stat!=NULL &&
+ !(file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_fasttxt &&
strcmp(file_recovery->extension,"mbox")==0))
{
@@ -948,7 +948,7 @@ static int header_check_txt(const unsigned char *buffer, const unsigned int buff
{
return 0;
}
- if(file_recovery!=NULL && file_recovery->file_stat!=NULL)
+ if(file_recovery->file_stat!=NULL)
{
if(file_recovery->file_stat->file_hint == &file_hint_doc)
{
@@ -1104,7 +1104,7 @@ static int header_check_txt(const unsigned char *buffer, const unsigned int buff
#endif
}
else if(strstr(buffer_lower, "class")!=NULL &&
- (l>=100 || file_recovery==NULL))
+ (l>=100 || file_recovery->file_stat==NULL))
{
#ifdef DJGPP
ext="jav";
@@ -1135,7 +1135,7 @@ static int header_check_txt(const unsigned char *buffer, const unsigned int buff
{
ext="html";
}
- if(file_recovery!=NULL && file_recovery->file_stat!=NULL)
+ if(file_recovery->file_stat!=NULL)
{
if(file_recovery->file_stat->file_hint == &file_hint_doc)
{
diff --git a/src/file_wtv.c b/src/file_wtv.c
index bf79873..fe4fbcb 100644
--- a/src/file_wtv.c
+++ b/src/file_wtv.c
@@ -56,7 +56,7 @@ static void register_header_check_wtv(file_stat_t *file_stat)
static int header_check_wtv(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(file_recovery!=NULL && file_recovery->file_stat!=NULL &&
+ if(file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_wtv &&
file_recovery->file_size<=0x3000)
return 0;
diff --git a/src/file_zip.c b/src/file_zip.c
index 68fc487..8fef36f 100644
--- a/src/file_zip.c
+++ b/src/file_zip.c
@@ -826,7 +826,7 @@ static int header_check_zip(const unsigned char *buffer, const unsigned int buff
{
const zip_file_entry_t *file=(const zip_file_entry_t *)&buffer[4];
const unsigned int len=le16(file->filename_length);
- if(file_recovery!=NULL && file_recovery->file_stat!=NULL &&
+ if(file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_doc &&
(strcmp(file_recovery->extension,"doc")==0 ||
strcmp(file_recovery->extension,"psmodel")==0)
@@ -834,7 +834,7 @@ static int header_check_zip(const unsigned char *buffer, const unsigned int buff
return 0;
/* A zip file begins by ZIP_FILE_ENTRY, this signature can also be
* found for each compressed file */
- if(file_recovery!=NULL && file_recovery->file_stat!=NULL &&
+ if(file_recovery->file_stat!=NULL &&
file_recovery->file_stat->file_hint==&file_hint_zip &&
safe_header_only==0)
return 0;