From dcbe3146b882a731e1cd82025607bd423bb82024 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 9 Feb 2016 16:33:23 +0000 Subject: [PATCH] Fix error in printing hex --- src/libutil/printf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libutil/printf.c b/src/libutil/printf.c index 29ca8cfb1..a0b75f5bd 100644 --- a/src/libutil/printf.c +++ b/src/libutil/printf.c @@ -603,8 +603,8 @@ rspamd_vprintf_common (rspamd_printf_append_func func, while (slen) { hexbuf[0] = hex == 2 ? _HEX[*p & 0xf] : _hex[*p & 0xf]; - hexbuf[1] = hex == 2 ? _HEX[(*p >> 8) & 0xf] : - _hex[(*p >> 8) & 0xf]; + hexbuf[1] = hex == 2 ? _HEX[(*p >> 4) & 0xf] : + _hex[(*p >> 4) & 0xf]; RSPAMD_PRINTF_APPEND_BUF (hexbuf, 2); p++; slen--; -- 2.39.5