summaryrefslogtreecommitdiffstats
path: root/src/file_txt.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2013-06-01 18:06:35 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2013-06-01 18:06:35 +0200
commit65dbe3d4baf4d486bb8119ec197a20697ba4ca28 (patch)
tree1ed5c06affe799b8c4d8efd188a5b4197c6b9dcf /src/file_txt.c
parent8ab840414394e1e8454413485c578d75fd8ab68f (diff)
constify more variables
Diffstat (limited to 'src/file_txt.c')
-rw-r--r--src/file_txt.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/file_txt.c b/src/file_txt.c
index 85ea044..5c22178 100644
--- a/src/file_txt.c
+++ b/src/file_txt.c
@@ -417,9 +417,8 @@ static int UTFsize(const unsigned char *buffer, const unsigned int buf_len)
static int data_check_html(const unsigned char *buffer, const unsigned int buffer_size, file_recovery_t *file_recovery)
{
const char sign_html_end[] = "</html>";
- unsigned int i;
+ const unsigned int i=UTFsize(&buffer[buffer_size/2], buffer_size/2);
unsigned int j;
- i=UTFsize(&buffer[buffer_size/2], buffer_size/2);
for(j=(buffer_size/2>sizeof(sign_html_end)?buffer_size/2-sizeof(sign_html_end):0);
j+sizeof(sign_html_end)-1 < buffer_size;
j++)
@@ -442,8 +441,7 @@ 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;
- i=UTFsize(&buffer[buffer_size/2], buffer_size/2);
+ const unsigned int i=UTFsize(&buffer[buffer_size/2], buffer_size/2);
if(i<buffer_size/2)
{
if(i>=10)