]> source.dussan.org Git - rspamd.git/commitdiff
Fix error in printing hex
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 9 Feb 2016 16:33:23 +0000 (16:33 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 10 Feb 2016 23:10:49 +0000 (23:10 +0000)
src/libutil/printf.c

index 29ca8cfb14c8ad2f0ec5e1cfcf0424703b247dc1..a0b75f5bd6dd8b1d23a872674c9b1543cfb613d4 100644 (file)
@@ -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--;