From cd52d9752999450256b29e1f50ea2803333aeb4e Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 27 Jul 2007 01:58:49 +0000 Subject: [PATCH] refinement of r2510 --- libtransmission/metainfo.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libtransmission/metainfo.c b/libtransmission/metainfo.c index 6179057cb..db6d7b809 100644 --- a/libtransmission/metainfo.c +++ b/libtransmission/metainfo.c @@ -268,13 +268,11 @@ realparse( tr_info_t * inf, const uint8_t * buf, size_t size ) tr_err( "Torrent has no files." ); goto fail; } - for( i=0; ifileCount; ++i ) + + if( !inf->totalSize ) { - if( !inf->files[i].length ) - { - tr_err("File #%d, \"%s\" is zero bytes long.", (i+1), inf->files[i].name ); - goto fail; - } + tr_err( "Torrent is zero bytes long." ); + goto fail; } /* TODO add more tests so we don't crash on weird files */