libeech

BitTorrent library
git clone git://z3bra.org/libeech.git
Log | Files | Refs | README | LICENSE

commit af81ef0e03792a5408783394c1d9bc29dcc0ff0b
parent d1b10606edf81df3f81e863bca63384d9bc44ae3
Author: z3bra <contactatz3bradotorg>
Date:   Mon Jul  2 08:53:06 +0200

Fix issues with U32() macro

The macro was OR'ing values that were not zeroed, thus resulting in bad
values if integers were included crap random bits.

Diffstat:
libeech.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libeech.c b/libeech.c @@ -19,7 +19,7 @@ #include "libeech.h" /* return a 4 byte array as a 32 bit integer */ -#define U32(s) ((uint32_t)((s)[0])<<24|((s)[1])<<16|((s)[2])<<8|((s)[3])) +#define U32(s) ((uint32_t)(((s)[0]&0xff)<<24|((s)[1]&0xff)<<16|((s)[2]&0xff)<<8|((s)[3]&0xff))) /* Associate message types with their numerical value */ enum {