summaryrefslogtreecommitdiffstats
path: root/src/file_win.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2019-12-29 17:31:36 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2019-12-29 17:31:36 +0100
commitea04bad2e52cfbba4bde257676151137ea350c5c (patch)
tree232e1c872df75171a52c4460306aa58b3da1a7f9 /src/file_win.c
parent77850b8710f0eb577100fea70e41d511cff91134 (diff)
src/file_txt.c: add a lot of frama-c annotations
Diffstat (limited to 'src/file_win.c')
-rw-r--r--src/file_win.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/file_win.c b/src/file_win.c
index 4db35b6..9e8b726 100644
--- a/src/file_win.c
+++ b/src/file_win.c
@@ -49,19 +49,16 @@ const file_hint_t file_hint_win= {
static data_check_t data_check_win(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);
unsigned int offset=0;
if(file_recovery->calculated_file_size==0)
offset=3;
- i=UTF2Lat((unsigned char*)buffer_lower, &buffer[buffer_size/2+offset], buffer_size/2-offset);
+ i=UTFsize(&buffer[buffer_size/2+offset], buffer_size/2-offset);
if(i<buffer_size/2-offset)
{
if(i>=10)
file_recovery->calculated_file_size=file_recovery->file_size+offset+i;
- free(buffer_lower);
return DC_STOP;
}
- free(buffer_lower);
file_recovery->calculated_file_size=file_recovery->file_size+(buffer_size/2);
return DC_CONTINUE;
}