diff --git a/clamav-devel/ChangeLog b/clamav-devel/ChangeLog index 051e85cb6..864fa3df0 100644 --- a/clamav-devel/ChangeLog +++ b/clamav-devel/ChangeLog @@ -1,3 +1,7 @@ +Thu May 18 12:00:23 CEST 2006 (tk) +---------------------------------- + * libclamav/str.c: cli_hex2int: small tweak from NJH + Tue May 16 21:15:25 BST 2006 (njh) ---------------------------------- * libclamav/mbox.c: Some HTML.Phishing.Bank-426 were getting through, diff --git a/clamav-devel/libclamav/str.c b/clamav-devel/libclamav/str.c index 978041183..15d9dc97b 100644 --- a/clamav-devel/libclamav/str.c +++ b/clamav-devel/libclamav/str.c @@ -34,13 +34,16 @@ static int cli_hex2int(int c) { - int l = tolower(c); + int l; - if (!isascii(l)) + if(!isascii(c)) return -1; - if (isdigit(l)) - return l - '0'; - if ((l >= 'a') && (l <= 'f')) + + if(isdigit(c)) + return c - '0'; + + l = tolower(c); + if((l >= 'a') && (l <= 'f')) return l + 10 - 'a'; cli_errmsg("hex2int() translation problem (%d)\n", l);