openbsd-ports/security/clamav/patches/patch-libclamav_str_c
2007-02-28 20:31:08 +00:00

27 lines
688 B
Plaintext

$OpenBSD: patch-libclamav_str_c,v 1.2 2007/02/28 20:31:08 mbalmer Exp $
--- libclamav/str.c.orig Sun Feb 11 01:35:22 2007
+++ libclamav/str.c Wed Feb 14 08:26:32 2007
@@ -97,8 +97,8 @@ short int *cli_hex2si(const char *hex)
char *cli_hex2str(const char *hex)
{
- char *str, *ptr, val, c;
- int i, len;
+ char *str, *ptr, val;
+ int c, i, len;
len = strlen(hex);
@@ -116,9 +116,9 @@ char *cli_hex2str(const char *hex)
for(i = 0; i < len; i += 2) {
if((c = cli_hex2int(hex[i])) >= 0) {
- val = c;
+ val = (char)c;
if((c = cli_hex2int(hex[i+1])) >= 0) {
- val = (val << 4) + c;
+ val = (val << 4) + (char)c;
} else {
free(str);
return NULL;