libeech

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

commit 286c8e057c6773a0179200a7d964e4fcb4133010
parent b033a8902e08c34d57038b8358ea736e77138582
Author: z3bra <contactatz3bradotorg>
Date:   Thu Oct 19 16:24:36 +0200

Simplify infohash() checksum calculus

Diffstat:
libeech.c | 4+---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/libeech.c b/libeech.c @@ -47,9 +47,7 @@ infohash(struct torrent *t) if (bekv(&t->be, "info", 4, &be) < 0) return NULL; sp = be.off; - if (benext(&be) < 0) - return NULL; - sha1(sp, be.off - sp, hash); + sha1(sp, be.end - be.start, hash); return hash; }