summaryrefslogtreecommitdiffstats
path: root/src/file_txt.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-04-11 19:34:53 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2013-04-11 19:34:53 +0200
commita33ecafd65ee92d7457f855a5fbc57ada9bbd5f5 (patch)
tree052c60a5135dc8464850f0f0a68ec5e4d1104557 /src/file_txt.c
parentb6b60e1e51bb0c67532e607a7b42098fe4216c97 (diff)
PhotoRec: modify data_check_txt() to use UTFsize() instead of UTF2Lat()
Diffstat (limited to 'src/file_txt.c')
-rw-r--r--src/file_txt.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/file_txt.c b/src/file_txt.c
index ec656f4..d1544d7 100644
--- a/src/file_txt.c
+++ b/src/file_txt.c
@@ -443,16 +443,13 @@ static int data_check_html(const unsigned char *buffer, const unsigned int buffe
static int data_check_txt(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery)
{
unsigned int i;
- char *buffer_lower=(char *)MALLOC(buffer_size+16);
- i=UTF2Lat((unsigned char*)buffer_lower, &buffer[buffer_size/2], buffer_size/2);
+ i=UTFsize(&buffer[buffer_size/2], buffer_size/2);
if(i<buffer_size/2)
{
if(i>=10)
file_recovery->calculated_file_size=file_recovery->file_size+i;
- free(buffer_lower);
return 2;
}
- free(buffer_lower);
file_recovery->calculated_file_size=file_recovery->file_size+(buffer_size/2);
return 1;
}