torrentd

simple torrent daemon
git clone git://git.2f30.org/torrentd
Log | Files | Refs | LICENSE

commit 315fddd11fdc92ba01c3d80a08dc0e33e81a5cff
parent d0de47437f0242335c46d3ca9331af7ecf855e1f
Author: sin <sin@2f30.org>
Date:   Mon, 21 Dec 2015 20:16:46 +0000

No need for goto

Diffstat:
Mtracker.c | 9+++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/tracker.c b/tracker.c @@ -26,10 +26,10 @@ getpeers(struct torrent *t, struct ben **reply) free(infohash); free(url); if (r < 0 || (size_t)r >= sizeof(buf)) - goto err0; + return -1; if ((s = dial(host, port)) < 0) - goto err0; + return -1; writeall(s, buf, r); r = readall(s, buf, sizeof(buf) - 1); @@ -46,10 +46,7 @@ getpeers(struct torrent *t, struct ben **reply) } if (!bdecode(p, p + r, reply)) - goto err0; + return -1; bprint(*reply, 0); - return 0; -err0: - return -1; }