]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Have tinytest tolerate systems where char has > 8 bytes
authorNick Mathewson <nickm@torproject.org>
Tue, 17 Feb 2015 13:40:55 +0000 (08:40 -0500)
committerNick Mathewson <nickm@torproject.org>
Tue, 17 Feb 2015 13:40:55 +0000 (08:40 -0500)
CID 1064418

src/ext/tinytest.c

index cc054ad34056bd7f98cdbe03d111615298555c7f..f6baeeb9a56009c515d06754940f9cd54533d0d5 100644 (file)
@@ -490,7 +490,7 @@ tinytest_format_hex_(const void *val_, unsigned long len)
                return strdup("<allocation failure>");
        cp = result;
        for (i=0;i<len;++i) {
-               *cp++ = "0123456789ABCDEF"[val[i] >> 4];
+               *cp++ = "0123456789ABCDEF"[(val[i] >> 4)&0x0f];
                *cp++ = "0123456789ABCDEF"[val[i] & 0x0f];
        }
        while (ellipses--)