libeech

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

commit af359fd15ba51750850011b0fd8525d0fe08f45c
parent 073f62ba589de7076916bc88119e6bc64ff0990b
Author: z3bra <contactatz3bradotorg>
Date:   Mon Oct 23 14:10:05 +0200

Use torrent.info in torrentsize()

Diffstat:
libeech.c | 7+++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/libeech.c b/libeech.c @@ -38,10 +38,9 @@ torrentsize(struct torrent *t) { int i; long l, sz = 0; - struct be info, file; + struct be file; - bekv(&t->be, "info", 4, &info); - if (!bekv(&info, "files", 5, &file)) { + if (!bekv(&t->info, "files", 5, &file)) { for (i = 0; !belistnext(&file) && !belistover(&file); i++) { l = bekint(&file, "length", 6); if (l < 0) @@ -49,7 +48,7 @@ torrentsize(struct torrent *t) sz += l; } } else { - sz = bekint(&info, "length", 6); + sz = bekint(&t->info, "length", 6); if (sz < 0) return -1; }