summaryrefslogtreecommitdiffstats
path: root/src/file_sig.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2012-12-08 17:58:27 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2012-12-08 17:58:27 +0100
commit190b91b85e64505fecda5bbc920c9f95fe02d964 (patch)
tree9e26392de7b948956d50d67a37ae2c96464d23cc /src/file_sig.c
parent80385c0ed135bc24b9241e31b432afee63bc4e09 (diff)
various code cleanup
Diffstat (limited to 'src/file_sig.c')
-rw-r--r--src/file_sig.c9
1 files changed, 3 insertions, 6 deletions
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')