summaryrefslogtreecommitdiffstats
path: root/src/file_psp.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_psp.c
parent8ab840414394e1e8454413485c578d75fd8ab68f (diff)
constify more variables
Diffstat (limited to 'src/file_psp.c')
-rw-r--r--src/file_psp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/file_psp.c b/src/file_psp.c
index 745d43b..af71e67 100644
--- a/src/file_psp.c
+++ b/src/file_psp.c
@@ -53,7 +53,7 @@ static int data_check_psp(const unsigned char *buffer, const unsigned int buffer
while(file_recovery->calculated_file_size + buffer_size/2 >= file_recovery->file_size &&
file_recovery->calculated_file_size + 10 < file_recovery->file_size + buffer_size/2)
{
- unsigned int i=file_recovery->calculated_file_size - file_recovery->file_size + buffer_size/2;
+ const unsigned int i=file_recovery->calculated_file_size - file_recovery->file_size + buffer_size/2;
if(memcmp(&buffer[i], "~BK\0", 4) != 0)
return 2;
/* chunk: header, id, total_length */
@@ -65,10 +65,9 @@ static int data_check_psp(const unsigned char *buffer, const unsigned int buffer
static int header_check_psp(const unsigned char *buffer, const unsigned int buffer_size, const unsigned int safe_header_only, const file_recovery_t *file_recovery, file_recovery_t *file_recovery_new)
{
- unsigned int ver_major;
+ const unsigned int ver_major=buffer[0x20]+(buffer[0x21]<<8);
reset_file_recovery(file_recovery_new);
file_recovery_new->extension=file_hint_psp.extension;
- ver_major=buffer[0x20]+(buffer[0x21]<<8);
if(ver_major>=4)
{
file_recovery_new->calculated_file_size=0x24;