[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Have tinytest tolerate systems where char has > 8 bytes



commit 7620c613e8bdaa34120136c91f71ae0cf8cb8506
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Tue Feb 17 08:40:55 2015 -0500

    Have tinytest tolerate systems where char has > 8 bytes
    
    CID 1064418
---
 src/ext/tinytest.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ext/tinytest.c b/src/ext/tinytest.c
index cc054ad..f6baeeb 100644
--- a/src/ext/tinytest.c
+++ b/src/ext/tinytest.c
@@ -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--)



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits