Explorar el Código

Have tinytest tolerate systems where char has > 8 bytes

CID 1064418
Nick Mathewson hace 9 años
padre
commit
7620c613e8
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/ext/tinytest.c

+ 1 - 1
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--)