torrentd

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

commit 7a74f47a946025e7830aa5d9320864290558f9c1
parent fdbdc988faebba9dd9bd46b11f24ee9789a88836
Author: sin <sin@2f30.org>
Date:   Fri, 18 Dec 2015 15:24:25 +0000

More updates

Diffstat:
Msbtd.c | 18+++++++++++++++---
Mtorrent.c | 1-
2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/sbtd.c b/sbtd.c @@ -17,12 +17,24 @@ #include <stdint.h> #include <stdio.h> #include <stdlib.h> -#include <string.h> #include "sbtd.h" +static void +usage(char *argv0) +{ + fprintf(stderr, "usage: %s torrent\n", argv0); + exit(1); +} + int -main(void) +main(int argc, char *argv[]) { - return 0; + struct torrent *t; + + if (argc != 2) + usage(argv[0]); + t = loadtorrent(argv[1]); + unloadtorrent(t); + exit(0); } diff --git a/torrent.c b/torrent.c @@ -72,7 +72,6 @@ loadtorrent(char *f) goto err2; } t->filename = bstr2str(dlookstr(t->info, "name")); - puts(t->filename); if (!dlookstr(t->info, "length")) { warnx("no length field in %s", f);