From 9d5967bbb6fe9a7b997a6f13d0a5033c439bdf81 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 2 Feb 2016 17:43:15 +0000 Subject: [PATCH] Fix hex encoding --- src/libutil/str_util.c | 6 +++--- 1 file 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 --; } -- 2.39.5