aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-02 17:43:15 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-02 17:43:15 +0000
commit9d5967bbb6fe9a7b997a6f13d0a5033c439bdf81 (patch)
treec0c1e9902a512474df38f430136c52e37dc4b4c5
parent16c29e5e15a80558fd42b9bdb52ee6def09858a2 (diff)
downloadrspamd-9d5967bbb6fe9a7b997a6f13d0a5033c439bdf81.tar.gz
rspamd-9d5967bbb6fe9a7b997a6f13d0a5033c439bdf81.zip
Fix hex encoding
-rw-r--r--src/libutil/str_util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c
index 17039bd6c..d488f0886 100644
--- a/src/libutil/str_util.c
+++ b/src/libutil/str_util.c
@@ -1280,7 +1280,7 @@ rspamd_encode_hex (const guchar *in, gsize inlen)
gchar *out, *o;
const guchar *p;
gsize outlen = inlen * 2 + 1;
- static const gchar hexdigests[16] = "0123456789ABCDEF";
+ static const gchar hexdigests[16] = "0123456789abcdef";
if (in == NULL) {
return NULL;
@@ -1291,8 +1291,8 @@ rspamd_encode_hex (const guchar *in, gsize inlen)
p = in;
while (inlen > 0) {
- *o++ = hexdigests[((*p >> 4) & 0xFF)];
- *o++ = hexdigests[((*p++) & 0xFF)];
+ *o++ = hexdigests[((*p >> 4) & 0xF)];
+ *o++ = hexdigests[((*p++) & 0xF)];
inlen --;
}