summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/file_exe.c3
-rw-r--r--src/file_sig.c9
-rw-r--r--src/partsun.c3
-rw-r--r--src/phcfg.c12
4 files changed, 9 insertions, 18 deletions
diff --git a/src/file_exe.c b/src/file_exe.c
index 9cd46fa..7aabe75 100644
--- a/src/file_exe.c
+++ b/src/file_exe.c
@@ -171,8 +171,7 @@ static int header_check_exe(const unsigned char *buffer, const unsigned int buff
)
{
/* MSDOS EXE */
- uint64_t coff_offset=0;
- coff_offset=le16(dos_hdr->blocks_in_file)*512;
+ uint64_t coff_offset=le16(dos_hdr->blocks_in_file)*512;
if(le16(dos_hdr->bytes_in_last_block))
coff_offset-=512-le16(dos_hdr->bytes_in_last_block);
diff --git a/src/file_sig.c b/src/file_sig.c
index 19e4a1b..6edd757 100644
--- a/src/file_sig.c
+++ b/src/file_sig.c
@@ -129,8 +129,7 @@ static FILE *open_signature_file(void)
if (home != NULL)
{
FILE*handle;
- char *filename=NULL;
- filename=(char*)MALLOC(strlen(home)+strlen(DOT_PHOTOREC_SIG)+1);
+ char *filename=(char*)MALLOC(strlen(home)+strlen(DOT_PHOTOREC_SIG)+1);
strcpy(filename, home);
strcat(filename, DOT_PHOTOREC_SIG);
handle=fopen(filename,"rb");
@@ -145,8 +144,7 @@ static FILE *open_signature_file(void)
}
#endif
{
- FILE*handle=NULL;
- handle=fopen(PHOTOREC_SIG,"rb");
+ FILE *handle=fopen(PHOTOREC_SIG,"rb");
if(handle!=NULL)
{
log_info("Open signature file %s\n", PHOTOREC_SIG);
@@ -334,8 +332,7 @@ static char *parse_signature_file(file_stat_t *file_stat, char *pos)
pos+=2;
while(isxdigit(*pos) && isxdigit(*(pos+1)))
{
- unsigned int val=0;
- val=(*pos);
+ unsigned int val=(*pos);
if(*pos>='0' && *pos<='9')
val-='0';
else if(*pos>='A' && *pos<='F')
diff --git a/src/partsun.c b/src/partsun.c
index 5ce33df..77e6b19 100644
--- a/src/partsun.c
+++ b/src/partsun.c
@@ -274,9 +274,8 @@ static void set_next_status_sun(const disk_t *disk_car, partition_t *partition)
static int test_structure_sun(list_part_t *list_part)
{ /* Return 1 if bad*/
- list_part_t *new_list_part=NULL;
int res;
- new_list_part=gen_sorted_partition_list(list_part);
+ list_part_t *new_list_part=gen_sorted_partition_list(list_part);
res=is_part_overlapping(new_list_part);
part_free_list_only(new_list_part);
return res;
diff --git a/src/phcfg.c b/src/phcfg.c
index 06297ac..cb4c5f8 100644
--- a/src/phcfg.c
+++ b/src/phcfg.c
@@ -107,8 +107,7 @@ static FILE *file_options_save_aux(void)
}
if(filename!=NULL)
{
- FILE*handle=NULL;
- handle=fopen(filename,"wb");
+ FILE *handle=fopen(filename,"wb");
if(handle)
{
log_info("Create file %s\n", filename);
@@ -121,8 +120,7 @@ static FILE *file_options_save_aux(void)
}
#endif
{
- FILE*handle=NULL;
- handle=fopen(PHOTOREC_CFG,"wb");
+ FILE *handle=fopen(PHOTOREC_CFG,"wb");
if(handle)
{
log_info("Create file %s\n", PHOTOREC_CFG);
@@ -178,8 +176,7 @@ static FILE *file_options_load_aux(void)
if (home != NULL)
{
FILE*handle;
- char *filename=NULL;
- filename=(char*)MALLOC(strlen(home)+strlen(DOT_PHOTOREC_CFG)+1);
+ char *filename=(char*)MALLOC(strlen(home)+strlen(DOT_PHOTOREC_CFG)+1);
strcpy(filename, home);
strcat(filename, DOT_PHOTOREC_CFG);
handle=fopen(filename,"rb");
@@ -194,8 +191,7 @@ static FILE *file_options_load_aux(void)
}
#endif
{
- FILE*handle=NULL;
- handle=fopen(PHOTOREC_CFG,"rb");
+ FILE *handle=fopen(PHOTOREC_CFG,"rb");
if(handle!=NULL)
{
log_info("Load parameters from %s\n", PHOTOREC_CFG);