From 95bc549bb15221c86c6e2693018970b2436bb2e0 Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Tue, 19 Apr 2011 08:24:20 +0200 Subject: [PATCH] PhotoRec: fix for custom signature using hexa --- src/file_sig.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/file_sig.c b/src/file_sig.c index 6c8681a4..c843e3b1 100644 --- a/src/file_sig.c +++ b/src/file_sig.c @@ -166,9 +166,9 @@ static char *str_uint(char *src, unsigned int *resptr) if(*src>='0' && *src<='9') res=res*16+(*src)-'0'; else if(*src>='A' && *src<='F') - res=res*16+(*src)-'A'; + res=res*16+(*src)-'A'+10; else if(*src>='a' && *src<='f') - res=res*16+(*src)-'a'; + res=res*16+(*src)-'a'+10; else { *resptr=res; @@ -310,18 +310,18 @@ static char *parse_signature_file(file_stat_t *file_stat, char *pos) if(*pos>='0' && *pos<='9') val-='0'; else if(*pos>='A' && *pos<='F') - val-='A'; + val=val-'A'+10; else if(*pos>='a' && *pos<='f') - val-='a'; + val=val-'a'+10; pos++; val*=16; val+=(*pos); if(*pos>='0' && *pos<='9') val-='0'; else if(*pos>='A' && *pos<='F') - val-='A'; + val=val-'A'+10; else if(*pos>='a' && *pos<='f') - val-='a'; + val=val-'a'+10; pos++; tmp[signature_size++]=val; }