PhotoRec: a text file must contains several lines

This commit is contained in:
Christophe Grenier 2013-04-11 19:38:44 +02:00
parent 9d4eb87787
commit ccb272200c

View file

@ -941,6 +941,18 @@ static int header_check_txt(const unsigned char *buffer, const unsigned int buff
l=UTF2Lat((unsigned char*)buffer_lower, buffer, buffer_size_test);
if(l<10)
return 0;
{
unsigned int line_nbr=0;
unsigned int i;
for(i=0; i<512 && i<l; i++)
{
if(buffer[i]=='\n')
line_nbr++;
}
/* A text file must contains several lines */
if(line_nbr==0)
return 0;
}
if(strncasecmp((const char *)buffer, "rem ", 4)==0)
{
reset_file_recovery(file_recovery_new);