summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2010-12-23 22:11:04 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2010-12-23 22:11:04 +0100
commit30d8427d31f2bbbdc22fd62cc5da287e728e3819 (patch)
tree6d5e7500e1bc5d4553ef543fbc46989db5173662 /src
parent488e05fc600040ab36fe46aa4849db1781876e28 (diff)
PhotoRec: fix the order of file checks
Diffstat (limited to 'src')
-rw-r--r--src/filegen.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/filegen.c b/src/filegen.c
index 8557e71..5a61fd6 100644
--- a/src/filegen.c
+++ b/src/filegen.c
@@ -58,7 +58,10 @@ static int file_check_cmp(const struct td_list_head *a, const struct td_list_hea
res=fc_a->offset-fc_b->offset;
if(res!=0)
return res;
- return memcmp(fc_a->value,fc_b->value, (fc_a->length<=fc_b->length?fc_a->length:fc_b->length));
+ res=memcmp(fc_a->value,fc_b->value, (fc_a->length<=fc_b->length?fc_a->length:fc_b->length));
+ if(res!=0)
+ return res;
+ return fc_b->length-fc_a->length;
}
static void file_check_add_tail(file_check_t *file_check_new, file_check_list_t *pos)